Comments on: Sort Lock Table http://stansight.com/WordPress/2007/10/07/sort-lock-table/ Coding for the Web - A JavaScript Resource Mon, 26 Jul 2010 12:53:41 -0400 hourly 1 http://wordpress.org/?v=3.0 By: Arun http://stansight.com/WordPress/2007/10/07/sort-lock-table/comment-page-1/#comment-1412 Arun Tue, 06 Apr 2010 12:04:43 +0000 http://stansight.com/WordPress/?p=3#comment-1412 Can you please try this, i have requirement where the first 3 columns in a table should be freezed during horizontall scroll. I tried a lot but coudn't acheive this. Can you please help with this? Can you please try this, i have requirement where the first 3 columns in a table should be freezed during horizontall scroll. I tried a lot but coudn’t acheive this. Can you please help with this?

]]>
By: Ravi http://stansight.com/WordPress/2007/10/07/sort-lock-table/comment-page-1/#comment-1409 Ravi Wed, 17 Mar 2010 16:23:03 +0000 http://stansight.com/WordPress/?p=3#comment-1409 Hi There, How are you doing..I'm looking for some example for locked sorting. Above piece of code suits for requirement, however it's not working in Safari browse. My observation in safari is header is scrolling up. Appreciate your valuable inputs to fix this issue. Thanks in advance.. -Ravi Hi There,

How are you doing..I’m looking for some example for locked sorting. Above piece of code suits for requirement, however it’s not working in Safari browse. My observation in safari is header is scrolling up. Appreciate your valuable inputs to fix this issue.

Thanks in advance..

-Ravi

]]>
By: Eddie Dodwell http://stansight.com/WordPress/2007/10/07/sort-lock-table/comment-page-1/#comment-1408 Eddie Dodwell Tue, 09 Mar 2010 16:11:09 +0000 http://stansight.com/WordPress/?p=3#comment-1408 I know this is an old thread, but being not a js programmer and loving your sortTables, I have a ?. Is there possibly a way to have 2 tr in the thead section that are left alone. The table has a 1st tr that is a multi column grouping and the 2nd tr is the actual column labels with the onclick sort. I have tried doing originalCol.shift(); twice to try to move down in the array, but to no avail. The 2 trs stay in place and sorts correctly, but the sort image disappears, the alternating tr colors are no longer altered and no highlight of sorted column. Sorted column highlight is no biggie really, but would like to retain alternateRow and sort img. Thanks for devoting time to these kind of scripts for we who are less talented. I know this is an old thread, but being not a js programmer and loving your sortTables, I have a ?. Is there possibly a way to have 2 tr in the thead section that are left alone. The table has a 1st tr that is a multi column grouping and the 2nd tr is the actual column labels with the onclick sort. I have tried doing originalCol.shift(); twice to try to move down in the array, but to no avail. The 2 trs stay in place and sorts correctly, but the sort image disappears, the alternating tr colors are no longer altered and no highlight of sorted column. Sorted column highlight is no biggie really, but would like to retain alternateRow and sort img.
Thanks for devoting time to these kind of scripts for we who are less talented.

]]>
By: choi http://stansight.com/WordPress/2007/10/07/sort-lock-table/comment-page-1/#comment-1398 choi Thu, 25 Feb 2010 13:35:58 +0000 http://stansight.com/WordPress/?p=3#comment-1398 Stan, A small problem, When I scroll,a small portion of the rows that moves upwards is visible from betwwwn the container border and the header top.Pls help Stan,

A small problem,

When I scroll,a small portion of the rows that moves upwards is visible from betwwwn the container border and the header top.Pls help

]]>
By: Frank http://stansight.com/WordPress/2007/10/07/sort-lock-table/comment-page-1/#comment-1396 Frank Mon, 15 Feb 2010 16:57:48 +0000 http://stansight.com/WordPress/?p=3#comment-1396 Stan - what great code. It’s very clean and elegant. I have used it for a few tables so far, and the users love it. However if there is a tag in the title, FF does not display properly. It causes FF to hide the scrollbar for the table but adds a scrollbar to the right side and to the bottom of the table but scrolls the required scrollbar for the table off screen to the right. If you scroll to the right, you can see and use the scrollbar for the table. To replicate this problem, add a ‘’ tag after ‘NAME’. Any suggestions? I can set this up on an external web site if needed. Stan – what great code. It’s very clean and elegant. I have used it for a few tables so far, and the users love it. However if there is a tag in the title, FF does not display properly. It causes FF to hide the scrollbar for the table but adds a scrollbar to the right side and to the bottom of the table but scrolls the required scrollbar for the table off screen to the right. If you scroll to the right, you can see and use the scrollbar for the table.

To replicate this problem, add a ‘’ tag after ‘NAME’.

Any suggestions? I can set this up on an external web site if needed.

]]>
By: chris http://stansight.com/WordPress/2007/10/07/sort-lock-table/comment-page-1/#comment-98 chris Tue, 25 Nov 2008 22:20:25 +0000 http://stansight.com/WordPress/?p=3#comment-98 Stan, I just stumbled across your great script and almost have it working the way I'd like. One thing I'm having trouble with is your demo table having entries in the name column that begin with numbers. I'd like a column for book titles but when I replace a name with a title that begins with a number, the column sorts incorrectly. Thanks in advance for any help... Stan,

I just stumbled across your great script and almost have it working the way I’d like. One thing I’m having trouble with is your demo table having entries in the name column that begin with numbers. I’d like a column for book titles but when I replace a name with a title that begins with a number, the column sorts incorrectly.

Thanks in advance for any help…

]]>
By: Stan Slaughter http://stansight.com/WordPress/2007/10/07/sort-lock-table/comment-page-1/#comment-90 Stan Slaughter Thu, 18 Sep 2008 12:29:44 +0000 http://stansight.com/WordPress/?p=3#comment-90 I'm glad you find it useful. :) That reminds me - I really do need to take the time and do a much more detailed write up on it. It's jammed full of interesting DOM techniques and tricks that really deserve to be pointed out and explained some where other than just inside the code itself. I’m glad you find it useful. :)

That reminds me – I really do need to take the time and do a much more detailed write up on it.

It’s jammed full of interesting DOM techniques and tricks that really deserve to be pointed out and explained some where other than just inside the code itself.

]]>
By: gordon http://stansight.com/WordPress/2007/10/07/sort-lock-table/comment-page-1/#comment-89 gordon Wed, 17 Sep 2008 14:41:51 +0000 http://stansight.com/WordPress/?p=3#comment-89 dear stan thanks for the script - it's genius and something i could never have come up with myself. i have implemented your script at http://www.passporttorichmond.co.uk/pubs/events.html and i have one problem. what changes do i have to make to sorttable.js so that empty cells in my table are always sorted as the last rows when a column heading is clicked. many thanks GA dear stan
thanks for the script – it’s genius and something i could never have come up with myself.

i have implemented your script at http://www.passporttorichmond.co.uk/pubs/events.html
and i have one problem.

what changes do i have to make to sorttable.js so that empty cells in my table are always sorted as the last rows when a column heading is clicked.

many thanks
GA

]]>
By: Stan Slaughter http://stansight.com/WordPress/2007/10/07/sort-lock-table/comment-page-1/#comment-75 Stan Slaughter Wed, 16 Jul 2008 13:46:28 +0000 http://stansight.com/WordPress/?p=3#comment-75 Interesting Martin. So you essentially added a a new type of item to the FormatForType function in sortTable.js One that would understand the unique content you wanted sorted in that column. Nice solution to your problem. I'm glad you got it to work for you. Interesting Martin. So you essentially added a a new type of item to the FormatForType function in sortTable.js

One that would understand the unique content you wanted sorted in that column.

Nice solution to your problem. I’m glad you got it to work for you.

]]>
By: Martin http://stansight.com/WordPress/2007/10/07/sort-lock-table/comment-page-1/#comment-74 Martin Sun, 13 Jul 2008 17:24:06 +0000 http://stansight.com/WordPress/?p=3#comment-74 Finally got it to work how I wanted. I added this code to the function for modifying the values. // If the item matches a mixed Letter/numeric pattern (e.g. 2a, 3c) if (itm.match(/([1-5][abc]$)/) || itm.match(/([W]$)/)) { // Replace letters or spaces with a number for sorting. if (itm.match(/([W]$)/)){sortValue = itm.replace(/([W])/g,1);} else if (itm.match(/(\d[a]$)/)){sortValue = itm.replace(/([a])/g,4);} else if (itm.match(/(\d[b]$)/)){sortValue = itm.replace(/([b])/g,3);} else if (itm.match(/(\d[c]$)/)){sortValue = itm.replace(/([c])/g,2);} else if (itm.match(/()/)){sortValue = itm.replace(/()/g,-1);} else {sortValue = sortValue;} if (isNaN(sortValue)) { // sortValue = sortValue.replace(/,/g,''); sortValue = 0; } else { sortValue = parseFloat(sortValue); } } It now seems to do exactly what I want without messing up the other sorting. Finally got it to work how I wanted.
I added this code to the function for modifying the values.

// If the item matches a mixed Letter/numeric pattern (e.g. 2a, 3c)
if (itm.match(/([1-5][abc]$)/) ||
itm.match(/([W]$)/)) {
// Replace letters or spaces with a number for sorting.
if (itm.match(/([W]$)/)){sortValue = itm.replace(/([W])/g,1);}
else if (itm.match(/(\d[a]$)/)){sortValue = itm.replace(/([a])/g,4);}
else if (itm.match(/(\d[b]$)/)){sortValue = itm.replace(/([b])/g,3);}
else if (itm.match(/(\d$)/)){sortValue = itm.replace(/()/g,2);}
else if (itm.match(/()/)){sortValue = itm.replace(/()/g,-1);}
else {sortValue = sortValue;}

if (isNaN(sortValue)) {
// sortValue = sortValue.replace(/,/g,”);
sortValue = 0;
} else {
sortValue = parseFloat(sortValue);
}
}

It now seems to do exactly what I want without messing up the other sorting.

]]>