[jQuery] Re: TableSorter and colspans
Hi Mike. Tablesorter used to support colspan until i found a bug in the checkCellColSpan function. I quick fixed it by removing the function called and forgot to update the docs. I have a new implementation on the way. Regards Christian 2009/9/5 Mike Alsup mal...@gmail.com Ive used the tablesorter alot in my projects, and Ive had the need for this as well. I found a DataTables plugin which looks like it can do colspans, but I havent tried it. I actually looked after reading your post to see if it supported the colspans now, as earlier versions didnt and I see it looks like it does. I figured out how to get this working in my project via TableSorter's textExtraction option. Would like to understand why the docs claim to support this however. -- Christian Bach Polyester* Wittstocksgatan 2nb 11524 Stockholm, Sweden +46 70 443 91 90
[jQuery] Re: sort table by class
Hi, The plugin name changed with the 2.0 release to .tablesorter(). Check out the docs @ http://tablesorter.com /Christian 2008/5/20 Luciano [EMAIL PROTECTED]: hi, i want create sort table in 3 tables byclass the code: $(.box table).tableSorter({ sortColumn: 'name', sortClassAsc: 'header-asc', sortClassDesc: 'header-desc', highlightClass: 'highlight', headerClass: 'header', }); but, return ERROR: $(.caixa table).tableSorter is not a function
[jQuery] Re: JQuery Tablesorter can't sort number in Coldfusion
Bettina, try downloading the latest development version: http://jqueryjs.googlecode.com/svn/trunk/plugins/tablesorter/2.0/ And see if it fixes the problem, there is a bug in the 2.0.3 version that doesn't auto detect number if the equal zero. /Christian 2008/5/20 Hamish Campbell [EMAIL PROTECTED]: H... CF might be causing the problem, but you'll still be able to see it in the generated code. Can you compare the output with and without cfoutput - the difference should give you a clue as to why it isn't working. On May 19, 11:59 pm, Bettina [EMAIL PROTECTED] wrote: Hi Yeah of course. Here i posted a picture how the table looks like: http://www.onebyte.ch/tablesorter.jpg But it must be a Problem with ColdFusion because wenn i leave the cfoutput away, and write the table and content by hand, the problem ist gone and its working. Its really weard. And the code from the site looks like this: link rel=stylesheet type=text/css href=http://192.168.88.5/ OneTool4/site/scripte/tablesorter/themes/blue/style.css script language=javascript src=http://192.168.88.5/OneTool4/site/ scripte/tablesorter/jquery.tablesorter.js/script script language=javascript $(document).ready(function() { // extend the default setting to always include the zebra widget. $.tablesorter.defaults.widgets = ['zebra']; // extend the default setting to always sort on the second column $.tablesorter.defaults.sortList = [[3,1]]; $(table).tablesorter({ // pass the headers argument and assing a object headers: { // assign the fourth column (we start counting zero) 5: { // disable it by setting the property sorter to false sorter: false } } });}); /script table class=tablesorter cellspacing=1 thead tr th width=25nbsp;/th th width=70Datum/th th width=250Titel/th th width=150Gefahrene Kilometer/th th nowrap=nowrapKategorie/th th width=17nbsp;/th /tr /thead tbody tr td align=center a href=act_change_param.cfm?param=statusvalue=0id=78img src=../images/status_aktiv.gif alt=aktiv, sichtbar title=aktiv, sichtbar border=0 //a /td td align=center13.02.2008/td tda href=index.cfm?incl=dsp_reise_auto_editedit=78Superman 2/a/td td align=center0/td tdSchweiz/td td a href=act_reise_auto_del.cfm?del=78 onClick=javascript:return confirm('Wollen Sie diesen Eintrag wirklich louml;schen?'); img src=../images/del.gif width=17 height=20 border=0 alt=Eintrag louml;schen title=Eintrag louml;schen /a/td /tr tr td align=center a href=act_change_param.cfm?param=statusvalue=0id=85img src=../images/status_aktiv.gif alt=aktiv, sichtbar title=aktiv, sichtbar border=0 //a /td td align=center01.01.2008/td tda href=index.cfm? incl=dsp_reise_auto_editedit=85Abschiebsparty/a/td td align=center0/td tdSchweiz/td td a href=act_reise_auto_del.cfm?del=85 onClick=javascript:return confirm('Wollen Sie diesen Eintrag wirklich louml;schen?'); img src=../images/del.gif width=17 height=20 border=0 alt=Eintrag louml;schen title=Eintrag louml;schen /a /td /tr tr td align=center a href=act_change_param.cfm?param=statusvalue=0id=87img src=../images/status_aktiv.gif alt=aktiv, sichtbar title=aktiv, sichtbar border=0 //a
[jQuery] Re: Select All Checkboxes and IE6
Hi Kevin, Take a look at the source of this page: http://tablesorter.com/tests/checkbox.html There is a special ie-checkbox widget, i wrote to deal with the checked state not being fired correctly in IE6. Happy tablesorting! /Christian 2008/3/25, Kevin Scholl [EMAIL PROTECTED]: Hello, all. I've searched though previous threads hoping to find some clue, but am still having issues with the following page: http://beta.ksscholl.com/jquery/tablesorter.html Click on the top or bottom checkbox, then do a sort on the table (with the fine tablesorter plugin). The checkboxes retain their state ... except, of course, in IE6. Clicking individual checkboxes and sorting is not an issue, so I suspect I'm missing something in my select/ deselect all routines: http://beta.ksscholl.com/jquery/js/jqcheckboxes.js (You can ignore the checkToggle and btnState functions there, as they are for another page.) I've looked at and tried so many things, that I fear I'm blinded to something simple at this point. Any assistance greatly appreciated ... thanks! Kevin
[jQuery] Re: Problem with tablesorter
Hi Guys, I will see to it that i incorporate this into the next bug fix version of tablesorter. Thanks for spotting it! /Christian 2008/1/17, Cesar [EMAIL PROTECTED]: I encountered this bug the alternate fix, if you want to use version 2.0 of the metadata plugin, is to open up tablesorter, and find/ replace $.meta/$.metadata and .data()/.metadata(). For the lazy people out there you can grab my version here: (Use at your own risk) http://blog.codafoo.com/javascripts/jquery.tablesorter.min.js On Jan 2, 8:51 am, KnoxBaby [EMAIL PROTECTED] wrote: got it to work with the version of metadata that comes with the release from tablesorter.com! On 1 Jan., 13:45, KnoxBaby [EMAIL PROTECTED] wrote: Hello, after a long discussion with karl about cluetip (http:// groups.google.com/group/jquery-en/browse_thread/thread/ 26229d51487e3bf9/2140d6480c81b21a#2140d6480c81b21a), I have the problem, that the inline options fortablesorterdon't work anymore: http://www.jahlabs.de/jquery/test/ e.g. I have set class={sorter: false} to the column Aktion since it's stupid to sort after it but that's not recognized anymore ... :( What's wrong about it??? Thanks :)
[jQuery] Re: Tablesorter dateFormat
Hi Jay, There was a small bug in the parser. This works as expected: $.tablesorter.addParser({ // set a unique id id: 'dates', is: function(s) { // return false so this parser is not auto detected return false; }, format: function(s) { // split var a = s.split('-'); // get month num a[1] = this.getMonth(a[1]); // glue and return a new date return new Date(a.reverse().join(/)).getTime(); }, getMonth: function(s) { var m = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'] var l = m.length; for(var i=0; i l; i++) { if(m[i] == s.toLowerCase()) { return (i+1); } } }, // set type, either numeric or text type: 'numeric' }); /Christian 2007/12/19, Jay Fallon [EMAIL PROTECTED]: Hi Christian, thanks for the follow up, I implemented the script as you described and it's still not sorting correctly: http://jayfallon.net/tablesorter/tablesorter.html On Dec 19, 1:21 pm, Christian Bach [EMAIL PROTECTED] wrote: Hi Jay, This will solve your problem: // add parser through the tablesorter addParser method $.tablesorter.addParser({ // set a unique id id: 'dates', is: function(s) { // return false so this parser is not auto detected return false; }, format: function(s) { // split var a = s.split('-'); // get month num a[1] = this.getMonth(a[1]); // glue and return a new date return new Date(a.join(/)).getTime(); }, getMonth: function(s) { var m = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'] var l = m.length; for(var i=0; i l; i++) { if(m[i] == s.toLowerCase()) { return (i+1); } } }, // set type, either numeric or text type: 'numeric' }); /christian 2007/12/18, Jay Fallon [EMAIL PROTECTED]: It's easy to write a parser to convert the months to a sortable value, but the days and years are trickier. the current code is as follows: // add parser through the tablesorter addParser method $.tablesorter.addParser({ // set a unique id id: 'dates', is: function(s) { // return false so this parser is not auto detected return false; }, format: function(s) { // format your data for normalization return s.toLowerCase ().replace(/dec/,12).replace(/nov/, 11).replace(/oct/,10).replace(/sep/,09).replace(/aug/,08).replace(/ jul/,07).replace(/jun/,06).replace(/may/,05).replace(/apr/, 04).replace(/mar/,03).replace(/feb/,02).replace(/jan/,01); }, // set type, either numeric or text type: 'numeric' }); $(function() { $.tablesorter.defaults.widgets = ['zebra']; $(#announcements).tablesorter({ headers: { 0: {sorter:'dates'},1: {sorter:false},2: {sorter:false},3: {sorter:false} } }); }); On Dec 18, 2:06 pm, Jay Fallon [EMAIL PROTECTED] wrote: I need to sort a table based on the date format: 10-Dec-2007. Does anyone know if this is possible with Tablesorter? I've tried us, uk iso to no avail. Thanks, Jay
[jQuery] Re: Tablesorter dateFormat
Hi Jay, This will solve your problem: // add parser through the tablesorter addParser method $.tablesorter.addParser({ // set a unique id id: 'dates', is: function(s) { // return false so this parser is not auto detected return false; }, format: function(s) { // split var a = s.split('-'); // get month num a[1] = this.getMonth(a[1]); // glue and return a new date return new Date(a.join(/)).getTime(); }, getMonth: function(s) { var m = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'] var l = m.length; for(var i=0; i l; i++) { if(m[i] == s.toLowerCase()) { return (i+1); } } }, // set type, either numeric or text type: 'numeric' }); /christian 2007/12/18, Jay Fallon [EMAIL PROTECTED]: It's easy to write a parser to convert the months to a sortable value, but the days and years are trickier. the current code is as follows: // add parser through the tablesorter addParser method $.tablesorter.addParser({ // set a unique id id: 'dates', is: function(s) { // return false so this parser is not auto detected return false; }, format: function(s) { // format your data for normalization return s.toLowerCase ().replace(/dec/,12).replace(/nov/, 11).replace(/oct/,10).replace(/sep/,09).replace(/aug/,08).replace(/ jul/,07).replace(/jun/,06).replace(/may/,05).replace(/apr/, 04).replace(/mar/,03).replace(/feb/,02).replace(/jan/,01); }, // set type, either numeric or text type: 'numeric' }); $(function() { $.tablesorter.defaults.widgets = ['zebra']; $(#announcements).tablesorter({ headers: { 0: {sorter:'dates'},1: {sorter:false},2: {sorter:false},3: {sorter:false} } }); }); On Dec 18, 2:06 pm, Jay Fallon [EMAIL PROTECTED] wrote: I need to sort a table based on the date format: 10-Dec-2007. Does anyone know if this is possible with Tablesorter? I've tried us, uk iso to no avail. Thanks, Jay
[jQuery] Re: tablesorter onafer feature?
Hi, there is a new undocumented features for this type of behaviour take a look at: http://tablesorter.com/docs/example-triggers.html /christian 2007/12/12, Arturo [EMAIL PROTECTED]: I use a code to bgcolor odd table rows in my tables. Something like: code $('table').find('tr:odd').css({backgroundColor: '#fffbdd'}); /code And I'd like to keep the zebra-colouring after a table sorting with tablesorter(). But I've looked at the docuentation on the plugin and it doesn't seem to provide a way to attach a function to the end of the tablesorting... Could this feature be added? Can this be done by any other means? Thanks a lot (for the great plugin and the eventual responses)!!
[jQuery] Re: accessible edit in place
Hi, Just extact the value of the input fields and replace it with a text node. This is untested but should work: $(input:text).each(function() { var $this=$(this); $this .after($(p/p) .html($this.val())) .hide(); }); /c 2007/12/7, Johan_S [EMAIL PROTECTED]: Hello. Is there a way / plugin to have this plugin work the other way around ? http://www.appelsiini.net/projects/jeditable/default.html If JS is turned off, i want the form controls to be visible on the page so you can use them. If JS is turned on, i want to activate them with a click/mouse over. I want the controls to be hidden and accessible on a need-to-use basis. If they're straight on the page from the beginning, it will feel like they should be filled out.. If JS is turned off I have no choice but to show them, and that's fine in that situation. Thanks! Best Johan --- Johan Sjöstrand Interaction Designer Phone: +46-(0)8-410 352 24 Mobile: +46-(0)709-27 52 24 www.doberman.se ---
[jQuery] Re: Tablesorter 2.0.1 removing rows and resorting
Nope, nothing wrong in what you are doing. Just make sure that trigger is called on the table and not the row. Ex. $(table).trigger(update); /c 2007/12/3, Adam Kroll [EMAIL PROTECTED]: I'm having problems with tablesorter 2.0.1 and removing rows. I'm allowing users to remove rows, and after a removing a row using a call to remove() I'm calling trigger(update), but if I remove a row and then resort it brings back the row I just removed. It looks like trigger(update) rebuilds the cache which should ignore the row I just removed, but it always comes back. Any ideas, or am I just totally missing something here?
[jQuery] Re: Tablesorter and event handlers on table rows
Hi Guys, This issue has been resolved in the latest tablesorter release. Get it from: http://tablesorter.com/ /Christian 2007/11/29, pambuk [EMAIL PROTECTED]: Hi, I have the exact same problem and frankly, I'm out of ideas. Last thing I tried was writing a widget, to rebind events, but clicks are fired n+1 number of sortings. I'm a JS (and jQuery) noob, but I'd really appreciate a solution / workaround / hack / whatever. I guess I'll sort the table through ajax or even reload the page :/, too bad, because I really liked the idea of using tablesorter. Raymond, could you please describe your workaround? On Nov 8, 3:20 pm, Raymond78 [EMAIL PROTECTED] wrote: Hi, First, a big thanks for creating this great plugin! Very nice. I am using TableSorter 2.0 on a table which contains rows on which I have added some event handlers (using jquery; the events have nothing to do with sorting, they're for highlighting and processing clicks). These event handlers work fine, until I click on a column heading to sort the table. The sorting works fine, but the event handlers don't work anymore. After having a look at the sourcecode, it seems to me that TableSorter effectively removes any event handlers because of the way it sorts the table. I studied all documentation and examples, but I couldn't find anything to do this. (There is something to trigger sorting, but that is the other way around.) My question is, is this correct, or am I overlooking something here? Is there is any way to preserve the row event handlers? For now, I have created a small workaround by passing an extra parameter that contains a function call, which is called after the sorting is finished; but if there is already a way to do this I'd like to know. I hope someone can help me out. Thanks in advance. Kind regards, Raymond
[jQuery] Re: TableSorter plug-in - custom sorting depending on direction?
Hi Scott, The parser will parse the value inside the table cell and store it's values in a huge array representing the table data. This is done only once per column and sorting direction. So setting a max / min value will only display the right way in one direction. /christian 2007/11/22, RichUncleSkeleton [EMAIL PROTECTED]: Here is my page: http://www.doheth.co.uk/db/world/country If you sort some columns (eg GDP) you will notice the blank values appear at the top. However, I want them to appear at the bottom. Initially I created a parser which set the value to Number.MAX_VALUE if it was '-'. But this moves the blank entries to the top when sorting in descending order. Is it possible to always have these at the bottom? Is it possible to detect the sort order inside my parser?
[jQuery] Re: parsers[i] has no properties
Hi Joe, Are you passing any sorter options to tablesorter? /christian 2007/11/5, [EMAIL PROTECTED] [EMAIL PROTECTED]: Has anyone been seeing the following in the firefox error console when sorting a tablesorter: parsers[i] has no properties line:482 It happens whenever a sort is run (on init, user input, or ajax). I assumed it was my custom parsers, so I removed them from my code but I'm still getting this error. In firebug I could see my parsers being added to $.tablesorter, but even the defaults seem to disappear once the object is instantiated. I'm using Tablesorter 2.0.1 with jquery-latest (1.2.1). If I'm the only one seeing this, I'd be willing to post my code. Thanks, Joe
[jQuery] Re: TableSorter docs suggestion
HI Shawn, Yeah your right, will add it to the docs as soon as i have the time. Thanks for the feedback! /christian 2007/10/3, sgrover [EMAIL PROTECTED]: I'm using the tablesorter plugin (Excellent work! - makes my job MUCH easier). But I found a slight flaw with the documentation. In my case, I wanted alternating row colors. When I set this up manually with something like $(#mytable tr:odd).css(background-color,#ddd); The initial view was fine, but sorting the rows messed things up. (not evenly alternating). So I did some digging. I recalled seeing something on this list about a zebra plugin. Searching my archives I found this, but could not find anything that clearly stated how to use it. So I went to the documentation at http://tablesorter.com/docs/. No mention there of zebra. When I went into the Widgets, writing your own, I found the following sample: // call the tablesorter plugin and assign widgets with id zebra //(Default widget in the core) and the newly created repeatHeaders $(table).tablesorter({ widgets: ['zebra','repeatHeaders'] }); This is the ONLY mention I found for Zebra within the tablesorter pages. (thus far) May I suggest that the table on the main docs page needs to include the widgets option, and a list of all the core widgets (not sure if there's more than just zebra). The alternating row colors is such a common need, that this change would make the tablesorter plugin much more friendly to those who only have a few moments to search. If I can only find documentation to complain about, somebody is doing something right... :) Good job Christian. Shawn
[jQuery] Re: How do I select an Element with the ID=foo.bar:data with jQuera Selectors?
try: jQuery('#foo\\.bar\\:filter'); 2007/9/27, ravenel [EMAIL PROTECTED]: Hello jQuery Coders! Since it is allowed to use ., : in the id-Tag (http://www.w3.org/ TR/html4/types.html#h-6.2) I wonder how I select it while using the jQuery Selector Syntax? jQuery('#foo.bar:filter') doesn't work since it means element with id foo and class bar and filter data? is this a bug a feature or a problem?
[jQuery] Re: Tablesorter dd/mm/YYY date problem
I like the idea! I don't have the time to put together such a solutions, is anyone interested in helping out? /christian 2007/9/26, Kia Niskavaara [EMAIL PROTECTED]: A suggestion is that all parsers (except the basic ones) are removed from the plugin, and selectable from an archive. This is very useful for custom date sorters etc, and will make the plugin even smaller. Jean wrote: Have i write my parser for dd/mm/ date format? The plugin use mm/dd/ either i changing in plugin configs
[jQuery] Re: Tablesorter dd/mm/YYY date problem
To change the date-format to the one you requested just pass the dateFormat options like this: $(table).tablesorter({dateFormat: 'uk'}); /christian 2007/9/26, Jean [EMAIL PROTECTED]: Unfortunally i´m a jquery noob =/ On 9/26/07, Christian Bach [EMAIL PROTECTED] wrote: I like the idea! I don't have the time to put together such a solutions, is anyone interested in helping out? /christian 2007/9/26, Kia Niskavaara [EMAIL PROTECTED]: A suggestion is that all parsers (except the basic ones) are removed from the plugin, and selectable from an archive. This is very useful for custom date sorters etc, and will make the plugin even smaller. Jean wrote: Have i write my parser for dd/mm/ date format? The plugin use mm/dd/ either i changing in plugin configs -- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com
[jQuery] Re: Adding :hover css support to IE6 - ie6HoverFix
Fabien, This needs to be done to support the :focus pseudo class. Getting the stylesheet with the native cssText method will return :focus as unkown. /christian 2007/9/23, Fabien Meghazi [EMAIL PROTECTED]: May I ask you why you are fetching inline/remote css in the updated version of your script instead if keeping using document.styleSheets ? Ok, understood, you're doing this because of :after As I'm not using it, I will use the old version with just support for :hover :focus -- Fabien Meghazi Website: http://www.amigrave.com Email: [EMAIL PROTECTED] IM: [EMAIL PROTECTED]
[jQuery] Re: Adding :hover css support to IE6 - ie6HoverFix
Updated the script to support :focus and :after http://lovepeacenukes.com/jquery/ie6cssfix/ /christian 2007/9/21, Christian Bach [EMAIL PROTECTED]: Unfortunately :after renders as unknown in ie6 :( So no luck there... 2007/9/21, Christian Bach [EMAIL PROTECTED]: That would be way cool, and not to hard to implement! /christian 2007/9/21, Brandon Aaron [EMAIL PROTECTED]: Well why not fix :after and :before too :) -- Brandon Aaron On 9/21/07, Christian Bach [EMAIL PROTECTED] wrote: Yeah that would make sense! A other thing that could be use full is to have a fix for the :focus selector in IE6. All though it will be returned as unknown in ie6. If you want to make a plugin and release it it's fine by me. /christian 2007/9/21, Fabien Meghazi [EMAIL PROTECTED]: 1. The script only looks for declarations in the stylesheets, that's the beauty of it. yes, but I mean that if you look at the content of the cssRules variable you will see that there are a lot of css declaration which could be avoided (or they can't ?) Christian, Ok, here's what I meant : In parseCss(), checking if css selector contains :hover (and return if not) will only do stuff on css selectors where :hover is present. I guess in most cases this is what we want. (correct me if I'm wrong). It's quite faster (I can feel it because I've got a 1ghz laptop :-) Anyway, here's a version of your script where we can choose if stuff should be done only for :hover selectors or not. Calling $.ie6HoverFix(); has the normal behaviour as you designed it. Calling $.ie6HoverFix(true); will redo css declaration only for :hover selectors Here it is. What do you think ? // ie6HoverFix - Author : Christian Bach $.ie6HoverFix = function(only_hovers) { if ($.browser.msie $.browser.version 7) { only_hovers = only_hovers || false; var cssRules = [], newStyleSheet = document.createStyleSheet(), styleSheets = document.styleSheets; function parseCSS(rule) { var prefix = ie6fix-; var select = rule.selectorText, style = rule.style.cssText; if (only_hovers select.indexOf(:hover) == -1) { return; } var element = select.replace(/:(hover).*$/, ''); var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, '$1'); var styleRule = element + . + prefix + pseudo; var className = prefix + pseudo; $(element).hover(function(e) { $(this).addClass(className); }, function(e) { $(this).removeClass(className) }); cssRules.push([styleRule,style]); } for (var i = 0, ii = styleSheets.length ; i ii; i++) { for(var j = 0, jj = styleSheets[i].rules.length; j jj; j++) { parseCSS(styleSheets[i].rules[j]); } } for (var i = 0, ii = cssRules.length; i ii; i++) { var ruledef = cssRules[i][1]; if (ruledef.length != 0) { newStyleSheet.addRule(cssRules[i][0], ruledef); } } } }; -- Fabien Meghazi Website: http://www.amigrave.com Email: [EMAIL PROTECTED] IM: [EMAIL PROTECTED]
[jQuery] Re: Announce: jQuery Tablesorter 2.0.1 Released
Bill, Try the updated version, it fixes this issue: http://tablesorter.com/jquery.tablesorter.pack.js /christian 2007/9/20, Bill Huber [EMAIL PROTECTED]: Thanks for the great work Christian! I did find that the 2.0.1 packed version does not work for me. It complains about a missing semi-colon. I ran the code through online lint(http://www.javascriptlint.com/online_lint.php) and it points at line 235. The unpacked and minified version worked since they are less particular about semi-colons. Enjoy! Bill -- View this message in context: http://www.nabble.com/Announce%3A-jQuery-Tablesorter-2.0.1-Released-tf4468417s15494.html#a12801762 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Adding :hover css support to IE6 - ie6HoverFix
Hi list, The other day i got feed up with ie6 not having :hover css support so i decided to fix it. Here is a simple script that solves the problem: http://lovepeacenukes.com/jquery/ie6hoverfix/ /christian
[jQuery] Re: Adding :hover css support to IE6 - ie6HoverFix
Joel: nope i didn't plan on adding it, but if you want you can add it. Brandon: thanks man! Fabien: 1. The script only looks for declarations in the stylesheets, that's the beauty of it. 2. If it was rewritten to use Brandons exellent livequery plugin it would work with load append etc. 3. Yeah i know but I'm lazy. /c 2007/9/21, Fabien Meghazi [EMAIL PROTECTED]: Here is a simple script that solves the problem: http://lovepeacenukes.com/jquery/ie6hoverfix/ Cool !! Got some questions: 1) would it be possible to detect :hover declarations in css in order to do stuff only on css rules that actually have a :hover declared 2) what if a $(#foo).load(index.html) is done. Will the new elements loaded benefit of your plugin or should $.ie6HoverFix(); function be called again ? Will this cause a problem if the function is called twice in the same DOM tree ? 3) As your loops have a lot of iteration I think you should avoid this kind of loops : for(var i = 0; i cssRules.length; i++) { and use this instead : for (var i = 0, ii = cssRules.length; i ii; i++) { this avoid the cssRules.length to be evaluated at each iteration (faster) Thanks for sharing this ! I will be able to get rid of those if ($.browser.msie) { $(table tr).hover(function() { $(this).addClass(hover); }, function() { $(this).removeClass(hover); }); } laying everywhere in my pages ;-) -- Fabien Meghazi Website: http://www.amigrave.com Email: [EMAIL PROTECTED] IM: [EMAIL PROTECTED]
[jQuery] Re: Adding :hover css support to IE6 - ie6HoverFix
Yeah that would make sense! A other thing that could be use full is to have a fix for the :focus selector in IE6. All though it will be returned as unknown in ie6. If you want to make a plugin and release it it's fine by me. /christian 2007/9/21, Fabien Meghazi [EMAIL PROTECTED]: 1. The script only looks for declarations in the stylesheets, that's the beauty of it. yes, but I mean that if you look at the content of the cssRules variable you will see that there are a lot of css declaration which could be avoided (or they can't ?) Christian, Ok, here's what I meant : In parseCss(), checking if css selector contains :hover (and return if not) will only do stuff on css selectors where :hover is present. I guess in most cases this is what we want. (correct me if I'm wrong). It's quite faster (I can feel it because I've got a 1ghz laptop :-) Anyway, here's a version of your script where we can choose if stuff should be done only for :hover selectors or not. Calling $.ie6HoverFix(); has the normal behaviour as you designed it. Calling $.ie6HoverFix(true); will redo css declaration only for :hover selectors Here it is. What do you think ? // ie6HoverFix - Author : Christian Bach $.ie6HoverFix = function(only_hovers) { if ($.browser.msie $.browser.version 7) { only_hovers = only_hovers || false; var cssRules = [], newStyleSheet = document.createStyleSheet(), styleSheets = document.styleSheets; function parseCSS(rule) { var prefix = ie6fix-; var select = rule.selectorText, style = rule.style.cssText; if (only_hovers select.indexOf(:hover) == -1) { return; } var element = select.replace(/:(hover).*$/, ''); var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, '$1'); var styleRule = element + . + prefix + pseudo; var className = prefix + pseudo; $(element).hover(function(e) { $(this).addClass(className); }, function(e) { $(this).removeClass(className) }); cssRules.push([styleRule,style]); } for (var i = 0, ii = styleSheets.length; i ii; i++) { for(var j = 0, jj = styleSheets[i].rules.length; j jj; j++) { parseCSS(styleSheets[i].rules[j]); } } for (var i = 0, ii = cssRules.length; i ii; i++) { var ruledef = cssRules[i][1]; if (ruledef.length != 0) { newStyleSheet.addRule(cssRules[i][0], ruledef); } } } }; -- Fabien Meghazi Website: http://www.amigrave.com Email: [EMAIL PROTECTED] IM: [EMAIL PROTECTED]
[jQuery] Re: Adding :hover css support to IE6 - ie6HoverFix
Unfortunately :after renders as unknown in ie6 :( So no luck there... 2007/9/21, Christian Bach [EMAIL PROTECTED]: That would be way cool, and not to hard to implement! /christian 2007/9/21, Brandon Aaron [EMAIL PROTECTED]: Well why not fix :after and :before too :) -- Brandon Aaron On 9/21/07, Christian Bach [EMAIL PROTECTED] wrote: Yeah that would make sense! A other thing that could be use full is to have a fix for the :focus selector in IE6. All though it will be returned as unknown in ie6. If you want to make a plugin and release it it's fine by me. /christian 2007/9/21, Fabien Meghazi [EMAIL PROTECTED]: 1. The script only looks for declarations in the stylesheets, that's the beauty of it. yes, but I mean that if you look at the content of the cssRules variable you will see that there are a lot of css declaration which could be avoided (or they can't ?) Christian, Ok, here's what I meant : In parseCss(), checking if css selector contains :hover (and return if not) will only do stuff on css selectors where :hover is present. I guess in most cases this is what we want. (correct me if I'm wrong). It's quite faster (I can feel it because I've got a 1ghz laptop :-) Anyway, here's a version of your script where we can choose if stuff should be done only for :hover selectors or not. Calling $.ie6HoverFix(); has the normal behaviour as you designed it. Calling $.ie6HoverFix(true); will redo css declaration only for :hover selectors Here it is. What do you think ? // ie6HoverFix - Author : Christian Bach $.ie6HoverFix = function(only_hovers) { if ($.browser.msie $.browser.version 7) { only_hovers = only_hovers || false; var cssRules = [], newStyleSheet = document.createStyleSheet(), styleSheets = document.styleSheets; function parseCSS(rule) { var prefix = ie6fix-; var select = rule.selectorText, style = rule.style.cssText; if (only_hovers select.indexOf(:hover) == -1) { return; } var element = select.replace(/:(hover).*$/, ''); var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, '$1'); var styleRule = element + . + prefix + pseudo; var className = prefix + pseudo; $(element).hover(function(e) { $(this).addClass(className); }, function(e) { $(this).removeClass(className) }); cssRules.push([styleRule,style]); } for (var i = 0, ii = styleSheets.length ; i ii; i++) { for(var j = 0, jj = styleSheets[i].rules.length; j jj; j++) { parseCSS(styleSheets[i].rules[j]); } } for (var i = 0, ii = cssRules.length; i ii; i++) { var ruledef = cssRules[i][1]; if (ruledef.length != 0) { newStyleSheet.addRule(cssRules[i][0], ruledef); } } } }; -- Fabien Meghazi Website: http://www.amigrave.com Email: [EMAIL PROTECTED] IM: [EMAIL PROTECTED]
[jQuery] Re: Adding :hover css support to IE6 - ie6HoverFix
That would be way cool, and not to hard to implement! /christian 2007/9/21, Brandon Aaron [EMAIL PROTECTED]: Well why not fix :after and :before too :) -- Brandon Aaron On 9/21/07, Christian Bach [EMAIL PROTECTED] wrote: Yeah that would make sense! A other thing that could be use full is to have a fix for the :focus selector in IE6. All though it will be returned as unknown in ie6. If you want to make a plugin and release it it's fine by me. /christian 2007/9/21, Fabien Meghazi [EMAIL PROTECTED]: 1. The script only looks for declarations in the stylesheets, that's the beauty of it. yes, but I mean that if you look at the content of the cssRules variable you will see that there are a lot of css declaration which could be avoided (or they can't ?) Christian, Ok, here's what I meant : In parseCss(), checking if css selector contains :hover (and return if not) will only do stuff on css selectors where :hover is present. I guess in most cases this is what we want. (correct me if I'm wrong). It's quite faster (I can feel it because I've got a 1ghz laptop :-) Anyway, here's a version of your script where we can choose if stuff should be done only for :hover selectors or not. Calling $.ie6HoverFix(); has the normal behaviour as you designed it. Calling $.ie6HoverFix(true); will redo css declaration only for :hover selectors Here it is. What do you think ? // ie6HoverFix - Author : Christian Bach $.ie6HoverFix = function(only_hovers) { if ($.browser.msie $.browser.version 7) { only_hovers = only_hovers || false; var cssRules = [], newStyleSheet = document.createStyleSheet(), styleSheets = document.styleSheets; function parseCSS(rule) { var prefix = ie6fix-; var select = rule.selectorText, style = rule.style.cssText; if (only_hovers select.indexOf(:hover) == -1) { return; } var element = select.replace(/:(hover).*$/, ''); var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, '$1'); var styleRule = element + . + prefix + pseudo; var className = prefix + pseudo; $(element).hover(function(e) { $(this).addClass(className); }, function(e) { $(this).removeClass(className) }); cssRules.push([styleRule,style]); } for (var i = 0, ii = styleSheets.length ; i ii; i++) { for(var j = 0, jj = styleSheets[i].rules.length; j jj; j++) { parseCSS(styleSheets[i].rules[j]); } } for (var i = 0, ii = cssRules.length; i ii; i++) { var ruledef = cssRules[i][1]; if (ruledef.length != 0) { newStyleSheet.addRule(cssRules[i][0], ruledef); } } } }; -- Fabien Meghazi Website: http://www.amigrave.com Email: [EMAIL PROTECTED] IM: [EMAIL PROTECTED]
[jQuery] Re: tablesorter pager error
Sorry! This is now resolved. Thanks for the heads up! /Christian 2007/9/19, Stoyan [EMAIL PROTECTED]: Anyone gets an error in the tablesortger pager example ? http://tablesorter.com/docs/example-pager.html missing ; before statement urn false}}).mousedown(function(){if(config.cancelSelection){ this.onselectstart=... -- Best regards, Stoyan
[jQuery] Re: Announce: jQuery Tablesorter 2.0.1 Released
Hi, I can take a look into this issue on Thursday. One way to solve this would either to have a option in the plugin constructor that would allow you to specify a row index or use the metadata plugin. Do you have a preferred way? /christian 2007/9/19, tlphipps [EMAIL PROTECTED]: Christian, have you had a chance to look into the issue with multiple tr tags in a thead? I've verified that this issue still exists with the 2.0.1 version of the tablesorter code. Any help or insight you could provide on this issue would be greatly appreciated. I sent the following off-list a few weeks ago: === I've setup an example page at: http://www.garethphipps.com/tablesorttest/index.html I've enabled debug mode for simplicity. Just to recap: This table has two tr tags in the thead. What is happening is that the checkCellColSpan() function is not properly filling the array of ths in this case. If I bypass that function and just create the array of ths myself, everything in the tablesorter works correctly. One note: Currently the second tr actually utilizes a colspan, but I originally was NOT using them in either tr. The issue existed before I added the colspan. As a side note, I couldn't figure out why you are passing 4 arguments to the checkCellColSpan() function. That could just be my lack of JavaScript knowledge. Also, I setup a second page with my modified tablesorter code that simply bypasses the checkCellColSpan() function so you can see the result I'm looking for. It's: http://www.garethphipps.com/tablesorttest/index2.html = On Sep 18, 6:02 am, Christian Bach [EMAIL PROTECTED] wrote: Thanks Kia, saved a few more bytes! Removed and updated tablesorter.com with the latest version. /christian 2007/9/18, Kia Niskavaara [EMAIL PROTECTED]: Thanks for the update!! I've noticed that you've included two almost identical sorters: $.tablesorter.addParser({ id: integer, is: function(s) { return s.match(new RegExp(/^\d+$/)); }, format: function(s) { return $.tablesorter.formatInt(s); }, type: numeric }); $.tablesorter.addParser({ id: integer, is: function(s) { return /^\d+$/.test(s); }, format: function(s) { return $.tablesorter.formatFloat(s); }, type: numeric }); Christian Bach wrote: Hi list! Just uploaded the new version of tablesorter that works with the 1.2 release of jQuery. Here are the main changes in version tablesorter 2.0.1 General * Removed the need for Dimensions plugin when using the pagination plugin thanks to offset being included in the jQuery 1.2 core. * Added support for jQuery 1.2 * Added new Minified version of tablesorter * Updated documenation and website with new examples Bug fixes * If row values are identical the original order is kept (Thanks to David hull) * If thead includes a table $('tbody:first', table) breaks (Thanks to David Hull) Speed improvements: * appendToTable, setting innerHTML to before appending new content to table body. * zebra widget. (Thanks to James Dempster) Get it all athttp://tablesorter.com Enjoy! /christian
[jQuery] Re: Announce: jQuery Tablesorter 2.0.1 Released
Hi Chris, Nope there is no reason other than that i forgot to delete it. Its removed now. Thanks for the feedback. /christian 2007/9/17, Chris [EMAIL PROTECTED]: Is there a reason jquery-1.1.3.js is included in the Zip file when 1.2.1 is required? On Sep 17, 12:37 pm, Christian Bach [EMAIL PROTECTED] wrote: Hi list! Just uploaded the new version of tablesorter that works with the 1.2release of jQuery. Here are the main changes in version tablesorter 2.0.1 General * Removed the need for Dimensions plugin when using the pagination plugin thanks to offset being included in the jQuery 1.2 core. * Added support for jQuery 1.2 * Added new Minified version of tablesorter * Updated documenation and website with new examples Bug fixes * If row values are identical the original order is kept (Thanks to David hull) * If thead includes a table $('tbody:first', table) breaks (Thanks to David Hull) Speed improvements: * appendToTable, setting innerHTML to before appending new content to table body. * zebra widget. (Thanks to James Dempster) Get it all athttp://tablesorter.com Enjoy! /christian
[jQuery] Re: Installation of UI?
On what page in the wiki did you find tableSorter? Could you point me to the page so i can change it. /christian 2007/9/18, Rabbit [EMAIL PROTECTED]: Ah, of course. It's tablesorter() -- lowercase 's'. The wiki needs to be updated to reflect that, as it uses a capital 'S'. On 9/17/07, Rabbit [EMAIL PROTECTED] wrote: [ If this is a duplicate I apologize -- it's been about 15 minutes and I don't see it on the list so I'm trying again. ] Hi all. I'm attempting to move to jQuery from MooTools, as I (generally) like the jQuery documentation better. However, I'm having trouble using the tableSorter function. I've downloaded jQuery 1.2.1 and UI 1.0. My JavaScript includes look like... script src=/javascripts/jquery-1.2.1.js?1190074502 type=text/ javascript/script script src=/javascripts/ui.tablesorter.js?1190019796 type=text/ javascript/script script src=/javascripts/rabbit.js?1190077112 type=text/ javascript/script jQuery works, as I use $(document).ready... (inside rabbit.js) to throw an alert. But calling $('#clients').tableSorter(); tells me no such function. Any ideas?
[jQuery] Re: Announce: jQuery Tablesorter 2.0.1 Released
Thanks Kia, saved a few more bytes! Removed and updated tablesorter.com with the latest version. /christian 2007/9/18, Kia Niskavaara [EMAIL PROTECTED]: Thanks for the update!! I've noticed that you've included two almost identical sorters: $.tablesorter.addParser({ id: integer, is: function(s) { return s.match(new RegExp(/^\d+$/)); }, format: function(s) { return $.tablesorter.formatInt(s); }, type: numeric }); $.tablesorter.addParser({ id: integer, is: function(s) { return /^\d+$/.test(s); }, format: function(s) { return $.tablesorter.formatFloat(s); }, type: numeric }); Christian Bach wrote: Hi list! Just uploaded the new version of tablesorter that works with the 1.2 release of jQuery. Here are the main changes in version tablesorter 2.0.1 General * Removed the need for Dimensions plugin when using the pagination plugin thanks to offset being included in the jQuery 1.2 core. * Added support for jQuery 1.2 * Added new Minified version of tablesorter * Updated documenation and website with new examples Bug fixes * If row values are identical the original order is kept (Thanks to David hull) * If thead includes a table $('tbody:first', table) breaks (Thanks to David Hull) Speed improvements: * appendToTable, setting innerHTML to before appending new content to table body. * zebra widget. (Thanks to James Dempster) Get it all at http://tablesorter.com Enjoy! /christian
[jQuery] Re: TableSorter properties
Hi Rigent, Try this: Change: table id=#sorttable To: table id=sorttable I will be releasing version 2.0.1 of tablesorter today or tomorrow with support for jQuery 1.2. /christian 2007/9/15, Rigent [EMAIL PROTECTED]: I'm loving the tablesorter plugin, everything works splendidly except I can't get a column to sort dates. Here's the init function I'm using to: - set the two CSS classes for the active TH, - disable sorting on the first column, - sort the 5th column by date, - force the first column sort onload, and - adding the Zebra rows widget. $(#sorttable).tablesorter( {cssAsc:sortasc,cssDesc:sortdesc, headers: {0: {sorter: false}, 4: {sorter: date}}, sortList: [[1,0]], widgets: ['zebra']} ); All of these work except the date sorting. I'm using the same date format used in the example on tablesorter.com and I've tried all the different ways to apply it that I can think of or that I've seen here in discussions. There's a great variety of examples, including putting '{sorter: date}' as a class in the TH! I was using JQuery 1.2 but the Zebra plugin seems to have a problem under 1.2 so I'm using an earlier version. I must be missing something as I'm not normally this clueless but it just won't work for me. Here's an example of the table I'm using: table id=#sorttable thead tr th width=7% class=nosortnbsp;/th th width=20%Initiative/th th width=18%Lead Agency /th th width=40%Description/th th width=15%Last Updated /th /tr /thead tbody tr td valign=top # Edit /td td valign=top view.php?id= A Name of the Initiative /td td valign=topOrganization name/td td valign=topPromoting healthy lifestyles.../td td valign=topApr 24, 2007 /td /tr tr td valign=top # Edit /td td valign=top view.php?id= B Name of the Initiative /td td valign=topOrganization name/td td valign=topA program designed.../td td valign=topJul 21, 2007 /td /tr etc Any advice gratefully received, thanks! -- View this message in context: http://www.nabble.com/TableSorter-properties-tf4445562s15494.html#a12684633 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: Tablesorter 2.0
Hi Guys, I have been stuck on a small island in Greece the last two weeks working on project called vacation. I will be releasing a 2.0.1 version of tablesorter (tonight or tomorrow) that takes care of these issues. /christian 2007/9/16, Rodrigo Moraes [EMAIL PROTECTED]: On 9/14/07, James Dempster wrote: The problem with Zebra Striping widget in tablesorter is because it uses a little bit of xpath, which has been taken out of jQuery 1.2, to fix this replace the format function on line 819 or around there with $( tbody:first tr:visible,table) .filter(':even') .removeClass(table.config.widgetZebra.css[1]).addClass( table.config.widgetZebra.css[0]) .end().filter(':odd') .removeClass(table.config.widgetZebra.css[0]).addClass( table.config.widgetZebra.css[1]) ; Could you describe the problem with zebra stripes? My TableSorter is working with jQuery 1.2, except that when you sort the table the stripes aren't updated. Is this the problem? Anyway, I don't see any functional difference using your code, but probably I'm missing something. Once I get some time, I'll implement two features I need: 1. Allow to define which thead row will be used to trigger sorting. By default, use the first row. This would allow multiple thead rows without breaking TableSorter execution. 2. Implement an Ajax pagination widget, to reload tbody rows with server-side data. Of course, I'll keep an eye on the community hacks to see if something similar appears. Hey, thanks for the plugin. It is super simple but slick. Lovely stuff. :) -- rodrigo moraes
[jQuery] Re: TableSorter properties
Hi, A very good undocumented feature is a option called debug, which will give you all kinds of information about what tablesorter is up to. Try this: $(#sorttable).tablesorter( {cssAsc:sortasc,cssDesc:sortdesc, headers:{0: {sorter: false}, 4: {sorter: date}}, sortList: [[1,0]], widgets:['zebra'], debug: true} ); /christian 2007/9/17, Rigent [EMAIL PROTECTED]: Oops, thanks Christian, that error was only in the post though, not in the actual HTML I'm using. If there's nothing fundamentally wrong with my init function I'll wait and see if your updates tomorrow fix it. Thanks again for your work on this plugin. Cheers Christian Bach wrote: Hi Rigent, Try this: Change: table id=#sorttable To: table id=sorttable I will be releasing version 2.0.1 of tablesorter today or tomorrow with support for jQuery 1.2. /christian -- View this message in context: http://www.nabble.com/TableSorter-properties-tf4445562s15494.html#a12737751 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Announce: jQuery Tablesorter 2.0.1 Released
Hi list! Just uploaded the new version of tablesorter that works with the 1.2 release of jQuery. Here are the main changes in version tablesorter 2.0.1 General * Removed the need for Dimensions plugin when using the pagination plugin thanks to offset being included in the jQuery 1.2 core. * Added support for jQuery 1.2 * Added new Minified version of tablesorter * Updated documenation and website with new examples Bug fixes * If row values are identical the original order is kept (Thanks to David hull) * If thead includes a table $('tbody:first', table) breaks (Thanks to David Hull) Speed improvements: * appendToTable, setting innerHTML to before appending new content to table body. * zebra widget. (Thanks to James Dempster) Get it all at http://tablesorter.com Enjoy! /christian
[jQuery] Re: Tablesorter plugin doesn't work properly with 1.2
Hi. I have been on vacation the last two weeks. I will be back next week so expect a patch then. /christian 2007/9/11, dobosgy [EMAIL PROTECTED]: I think so, that's why I sent this to the discussion list. Maybe he haven't noticed this issue yet by himself. :) -- Thanks, Gy On Sep 11, 11:00 pm, Brandon Aaron [EMAIL PROTECTED] wrote: I think the author is going to release an update that fixes this soon. -- Brandon Aaron
[jQuery] Re: tablesorter 2.0: problems with multiple rows in thead
Hi Travis, Would it be possible to send me a test-case of your table, off-list? Makes spotting the bug easier for me. Regards Christian 2007/8/28, tlphipps [EMAIL PROTECTED]: Tablesorter 2.0 rocks! But I think I've uncovered a bug. I have a table with two rows in the thead section, but the tablesorter doesn't work on this table. I've narrowed the issue down to the checkCellColSpan() function. If I bypass that function, then everything works correctly. I've discovered that the arr.push (line 302) command is never executed if there is more than one tr in the thead of the table. Also, I can't figure out why the call to this function at line 268 includes 4 parameters when the function only uses/ needs 3. I'm definitely not a javascript guru, so any help or insight that you all can provide would be greatly appreciated. FWIW, my table does NOT use colspans in the thead, so I don't need that function, but if there's an official fix for this I would prefer that instead of creating a customized version of the tablesorter for my needs.
[jQuery] Re: [NEWS] More Press for tableSorter
Thanks Rey! If anyone would like to help me get the word out even more, please feel free to digg: http://digg.com/programming/jQuery_plugin_Tablesorter_2_0 Best regards Christian 2007/8/24, Rey Bango [EMAIL PROTECTED]: The press continues around Christian Bach's tableSorter plugin. The most recent is an intro to the plugin on the AMIS Technology Blog: http://technology.amis.nl/blog/?p=2376 The phrase that caught my attention was I really love the tablesorter plugin. It's very easy to use and the code looks so clean!. Great work Christian!
[jQuery] Re: [NEWS] More Press for tableSorter
Thanks Brandon and Marshall! /christian 2007/8/24, Marshall Salinger [EMAIL PROTECTED]: I upgraded from 1.0 to 2.0 in my app and noticed a big improvement in speed. It is an excellent plug-in. Dugg! Christian Bach wrote: Thanks Rey! If anyone would like to help me get the word out even more, please feel free to digg: http://digg.com/programming/jQuery_plugin_Tablesorter_2_0 Best regards Christian 2007/8/24, Rey Bango [EMAIL PROTECTED]: The press continues around Christian Bach's tableSorter plugin. The most recent is an intro to the plugin on the AMIS Technology Blog: http://technology.amis.nl/blog/?p=2376 The phrase that caught my attention was I really love the tablesorter plugin. It's very easy to use and the code looks so clean!. Great work Christian!
[jQuery] Re: TableSorter Set Column Sorter to false
Dan, You need to include the jquery metadata plugin: script type=text/javascript src=../jquery.metadata.js/script See: http://tablesorter.com/docs/#Download /christian 2007/8/20, Dan Vega [EMAIL PROTECTED]: The examples do not say anything about a metadata widget, should my code look like this? script $(document).ready(function() { // call the tablesorter plugin $(table).tablesorter({ widgets: ['zebra','metadata'] }); }); /script On Aug 17, 5:29 pm, Christian Bach [EMAIL PROTECTED] wrote: Dan, in order to set options inline you need to include the metadata plugin. The reason why this seems to work with out metadata is because the auto detection for column sorter is working its magic. There is no need to specify sorters for standard columns like the ones that you have in your table. /christian 2007/8/17, Dan Vega [EMAIL PROTECTED]: From the docs I gather that I should be able to do the following: This should allow me to define the parser per column as well as to tell it that I do not want the edit column to be sortable. The parser definitions work fine but the sorter:false is not working. I want the edit column to be un-sortable, any suggestions? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd html head titleJQuery Grid/title !--- tablesorter --- link href=themes/blue/style.css type=text/css rel=stylesheet/ script type=text/javascript src=jquery.js/script script type=text/javascript src=jquery.tablesorter.js /script script $(document).ready(function() { // call the tablesorter plugin $(table).tablesorter({ widgets: ['zebra'] }); }); /script /head body div style=width:600px; table class=tablesorter cellspacing=1 thead tr th class={sorter: 'text'}First Name/th th class={sorter: 'text'}Last Name/th th class={sorter: 'integer'}Age/th th class={sorter: 'currency'}Total/th th class={sorter: 'percent'}Discount/th th class={sorter: 'date'}Date/th th class={sorter: false}Edit/th /tr /thead tbody tr tdPeter/td tdParker/td td28/td td$9.99/td td20%/td td07/06/2006/td tdEdit/td /tr tr tdJohn/td tdHood/td td33/td td$19.99/td td25%/td td11/10/2002/td tdEdit/td /tr tr tdClark/td tdKent/td td18/td td$15.89/td td44%/td td01/12/2003/td tdEdit/td /tr tr tdBruce/td tdAlmighty/td td45/td td$153.19/td td44%/td td01/18/2001/td tdEdit/td /tr tr tdBruce/td tdEvans/td td22/td td$13.19/td td11%/td td01/18/2007/td tdEdit/td /tr /tbody /table /div /body /html
[jQuery] Re: Tablesorter 2.0
Hi Lukek, I took an other approach to this. Check out: http://tablesorter.com/docs/example-extending-defaults.html Regards Christian 2007/8/20, lukek [EMAIL PROTECTED]: Been having a further poke around. I have done what Christian suggested and merged the widgets and parser arrays of this.config with those in settings. However now I have realised the constructor is being called twice - or the number of levels of inheritance. So many options not sure what to do... On Aug 20, 9:33 am, lukek [EMAIL PROTECTED] wrote: Thanks for getting back Christian - only just seen you post. I look forward to the fix. I will tinker with it and see what I come up with until then. By the way I had another question. -- In the unpacked version of the latest script your comment on line 555 says apply easy methods that trigger binded events. Does this mean I can insert function calls in here - ie around line 560? I say this because I have added a call to applyWidget() as I reckon all the widgets should be reloaded when the update event is triggered - eg after I insert rows I want to reapply the zebra widget. Unless I missed something or your plan was to control this action in some other way. Thanks Luke On Aug 17, 10:36 pm, Christian Bach [EMAIL PROTECTED] wrote: Lukek, I will supply a fix for this after the weekend. If you cant wait that long a tip is that if this.config exists that should be extended instead of the defaults. /christian 2007/8/17, lukek [EMAIL PROTECTED]: Hi, I have just been playing with the newTablesorter2.0. Thanks Mr Bach! Great piece of work. I am having problems getting tables to inherit widgets. I am not sure if its the way $.extend() merges arrays when passing the settings object to thetablesorter.construct() function or what but when I add more widgets it seems to overwrite the ones I added previously. EXAMPLE: table class=data id=myTable1 .../table table class=data id=myTable2 .../table script $(table.data).tablesorter( { widgets: [ 'zebra', 'someWidget', 'anotherWidget'] } ); $(#myTable2).tablesorter( { widgets: [ 'completelyDiffWidget' ] } ); /script Do you see what I'm doing? #myTable2 should now have all four widgets. But that's not what happens. Can anyone kindle point me in the right direction cheers Luke
[jQuery] Re: TableSorter 2.0 documentation notes
Thanks Chris, The docs are know updated. /christian 2007/8/19, Chris [EMAIL PROTECTED]: Two easy to fix errors: The example code in Getting Started uses tableSorter() several times rather than tablesorter(). Threw me off till I compared my code with other examples. http://tablesorter.com/docs/#Getting-Started The example code for text extraction has comments left over from forced sorting. http://tablesorter.com/docs/example-option-text-extraction.html
[jQuery] Re: TableSorter Set Column Sorter to false
Dan, in order to set options inline you need to include the metadata plugin. The reason why this seems to work with out metadata is because the auto detection for column sorter is working its magic. There is no need to specify sorters for standard columns like the ones that you have in your table. /christian 2007/8/17, Dan Vega [EMAIL PROTECTED]: From the docs I gather that I should be able to do the following: This should allow me to define the parser per column as well as to tell it that I do not want the edit column to be sortable. The parser definitions work fine but the sorter:false is not working. I want the edit column to be un-sortable, any suggestions? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd html head titleJQuery Grid/title !--- tablesorter --- link href=themes/blue/style.css type=text/css rel=stylesheet/ script type=text/javascript src=jquery.js/script script type=text/javascript src=jquery.tablesorter.js/script script $(document).ready(function() { // call the tablesorter plugin $(table).tablesorter({ widgets: ['zebra'] }); }); /script /head body div style=width:600px; table class=tablesorter cellspacing=1 thead tr th class={sorter: 'text'}First Name/th th class={sorter: 'text'}Last Name/th th class={sorter: 'integer'}Age/th th class={sorter: 'currency'}Total/th th class={sorter: 'percent'}Discount/th th class={sorter: 'date'}Date/th th class={sorter: false}Edit/th /tr /thead tbody tr tdPeter/td tdParker/td td28/td td$9.99/td td20%/td td07/06/2006/td tdEdit/td /tr tr tdJohn/td tdHood/td td33/td td$19.99/td td25%/td td11/10/2002/td tdEdit/td /tr tr tdClark/td tdKent/td td18/td td$15.89/td td44%/td td01/12/2003/td tdEdit/td /tr tr tdBruce/td tdAlmighty/td td45/td td$153.19/td td44%/td td01/18/2001/td tdEdit/td /tr tr tdBruce/td tdEvans/td td22/td td$13.19/td td11%/td td01/18/2007/td tdEdit/td /tr /tbody /table /div /body /html
[jQuery] Re: Tablesorter 2.0
Lukek, I will supply a fix for this after the weekend. If you cant wait that long a tip is that if this.config exists that should be extended instead of the defaults. /christian 2007/8/17, lukek [EMAIL PROTECTED]: Hi, I have just been playing with the new Tablesorter 2.0. Thanks Mr Bach! Great piece of work. I am having problems getting tables to inherit widgets. I am not sure if its the way $.extend() merges arrays when passing the settings object to the tablesorter.construct() function or what but when I add more widgets it seems to overwrite the ones I added previously. EXAMPLE: table class=data id=myTable1 .../table table class=data id=myTable2 .../table script $(table.data).tablesorter( { widgets: [ 'zebra', 'someWidget', 'anotherWidget'] } ); $(#myTable2).tablesorter( { widgets: [ 'completelyDiffWidget' ] } ); /script Do you see what I'm doing? #myTable2 should now have all four widgets. But that's not what happens. Can anyone kindle point me in the right direction cheers Luke
[jQuery] Re: [ANNOUNCE] tablesorter 2.0 released
Chris, Glean and Sean: Thanks! I'm really happy with this release and hopefully it will solve all your table sorting needs. /christian
[jQuery] Re: [ANNOUNCE] tablesorter 2.0 released
Thanks guys! I will see to it that i add a short overview to the examples. /christian
[jQuery] Re: [ANNOUNCE] tablesorter 2.0 released
Does anyone have an example of how to stripe the data rows? The default looks like it should be .odd .even and I am using the blue theme but nothing is getting striped. You need to pass the widgets option, try this: $(table).tablesorter({ sortForce: [0,0], widgets: ['zebra'] }); It seems that we forgot to document the widgets option, there's always something :) I will update tablesorter.com the first thing tomorrow, i really need to get some sleep. Regards Christian
[jQuery] [ANNOUNCE] tablesorter 2.0 released
Hi List, I just released the 2.0 version of tablesorter. Here are the highlight for this release: * Multi-column sorting * Parsers for sorting text, URIs, integers, currency, floats, IP addresses, dates (ISO, long and short formats), time. Add your own easily * Support for ROWSPAN and COLSPAN on TH elements * Support secondary hidden sorting (e.g., maintain alphabetical sort when sorting on other criteria) * Extensibility via widget system * Small code size (7,4kb packed) * Documentation Get it all at http://tablesorter.com Regards Christian
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
2007/7/19, Kia [EMAIL PROTECTED]: Personally I would prefer if the string wasn't lowercased. I think the parser should lowercase it (or use the regexp modifier 'i'), if needed. I will change this in time for the final release. /christian
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
That's not the case for me (the sizes are mixed up on the page). The normal one is 13.15 kb for me and the packed on is 6.73kb. If you pack using the Base62 encode option you can get it even smaller. Thanks Sam, i repacked it and got down to 5,2 KB. Updated the page to reflect the changes: http://lovepeacenukes.com/tablesorter/2.0/
[jQuery] ANNOUNCE: tablesorter 2.0 beta released!
After another late night, fixing a few bugs, the code is finally ready for it's first beta release. The main new features include: * Multi-column sorting * In-line support for setting options done via the class attribute on the TH elements. * The plugin has been re-written from scratch. * Support for rowspan and colspan on TH elements. * New widget support, more information in the docs. Hopefully this will take care of all the issues that was related to the 1.xrelease. The new 2.0 release can be found here: http://lovepeacenukes.com/tablesorter/2.0/ Best regards Christian
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
2007/7/17, David Duymelinck [EMAIL PROTECTED]: Christian Bach schreef: After another late night, fixing a few bugs, the code is finally ready for it's first beta release. The main new features include: * Multi-column sorting * In-line support for setting options done via the class attribute on the TH elements. * The plugin has been re-written from scratch. * Support for rowspan and colspan on TH elements. * New widget support, more information in the docs. Hopefully this will take care of all the issues that was related to the 1.x release. The new 2.0 release can be found here: http://lovepeacenukes.com/tablesorter/2.0/ Best regards Christian Just a tiny error on the page. I think the filesize in the links need to be switched. Sorry for the nitpicking :) Thanks David, there switched now :)
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
2007/7/17, Rick Pasotto [EMAIL PROTECTED]: On Tue, Jul 17, 2007 at 03:04:59PM +0200, Christian Bach wrote: The new 2.0 release can be found here: http://lovepeacenukes.com/tablesorter/2.0/ Interesting that the packed version is twice as large as the unpacked. :-) Yeah, packer doesn't always work as expected :)
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
I'm glad to see you made the multi-column sort key configurable. My instinct was to use the [CTRL] key, not the [SHIFT] key (although I know Outlook uses the [SHIFT] key.) Tablesorter can be configured to use either SHIFT or CTRL, all though SHIFT is default. Here is a example on how to change it to the control key: $(table).tablesorter({ sorting: { // valid values: ctrlKey, altKey, shiftKey multisortKey: 'ctrlKey', } }); /christian
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
excellent job christian, Thanks! i have one bug to report: consider this html if the tr element contains inline styles such as: tr style=background-color:red once sorted, the style is removed. I did a quick test, and the style attribute was not removed, perhaps the style is over-written by a css class? Tablesorter by default adds a class by the name .header to all th elements. /christian
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
Looks promising but I'm having a little problem with numeric sorting. Here's my invocation and the table header. $(function() { $(#listclubs).tablesorter(); }); theadtr th class={sorter:'integer'}ID#/th thClub Name/th thArea/th thType/th thCharter/th /tr/thead When the page first appears it is sorted the way I wrote it but if I click on the first column it does an alpha sort ('1055512' comes before '1312' and '1420'). Yeah, you need John's metadata plugin to allow in-line configuration, i totally forgot to mention that. You can grab it from here: http://jquery.com/dev/svn/trunk/plugins/metadata/lib/jQuery/metadata.js?format=txt Also, is it possible to apply a style to the table based on which column is sorted? Not at the moment i will see if i have the time to whip up a widget that could support that. And one more thing. I'm using cluetip.js on that first column and it no longer works. It should work, I'm not familiar with the cluetip plugin, but I'm not removing any thing from the table.
[jQuery] Re: ANNOUNCE: tablesorter 2.0 beta released!
Immediately after sending the above I think I realized what the problem is. Each of the numeric values in that first column is wrapped in a/a and you're probably sorting on that. Do I need to write a parser? If so, what might it be? This should work: $.tablesorter.addParser({ id: 'genericLink', is: function(s) { var exp = /a[^]*(.*)\/a/.test(s.toLowerCase()); if(exp) this.type = (/a[^]*(\d+)\/a/.test(s)) ? 'numeric' : 'text'; return exp; }, format: function(s) { var val = s.toLowerCase().match(/a[^]*(.*)\/a/)[1]; // format your data for normalization return (this.type == 'text') ? $.trim(val) : $.tablesorter.formatFloat(val); }, type: 'text' }); It works for a element with text and numeric values. /christian
[jQuery] tablesorter 2.0 - Shiny Brand new documentation!
Hi List, After many late night i have managed to sort out a documentation/FAQ, for the new 2.0 release. I hope to have included the most common questions/problems + showing off the new features, but i might have missed some, so any feedback on this would be great! The new documentation is located here: http://lovepeacenukes.com/tablesorter/2.0/docs/ The new tablesorter will be released next week. Best regards Christian
[jQuery] Re: tableSorter - sorting
Hi Phil, In the 1.x release there is a option called disableHeader Here is a example: // disable one header from being sorted disableHeader: 0 //disable more then one disableHeader: [0,5,8] /christian 2007/7/5, Phil Glatz [EMAIL PROTECTED]: Christian Bach wrote: And to leak a new feature: it will contain multiple column sorting. One more suggestion, if it isn't in there already: the ability to exclude some columns as sortable. The column wouldn't display the sorting class in the header, and clicking on it would have no effect. Maybe a list (array) of column names to use as sortable, or excluded from sorting. -- POLYESTER* Wittstocksgatan 2 115 24 Stockholm Phone: 08-660 73 50 / +46-8-660 73 50 Mobile: 070-443 91 90 / +46-70-443 91 90 E-mail: [EMAIL PROTECTED] http://www.polyester.se
[jQuery] Re: Preview: Brand new tablesorter 2.0, multi-column sorting and more
Paging, will have to be a upcoming feature, i will provide a new filter system that will allow developers to write small functions that will be applied after a sorting has finished. I will include a zebra table filter as default, of course these can be extended to allow paging etc. /christian 2007/7/6, MichaL Sanger [EMAIL PROTECTED]: I have same wish, paging is a must! =) MichaL 2007/7/6, Michael Stuhr [EMAIL PROTECTED]: Christian Bach schrieb: Hi, I put together a demo/preview for the upcoming release tablesorter 2.0 release. The main features of the upcoming release will be: - Multi-column sorting - Robust support for adding new data to the table, provided with the new update method - Support for custom filter (thinks zebra tables etc) and support for writing your own in the same manner as parsers. However the upcoming release will NOT be back words compatible, as a have chosen to rewrite it from the ground up, it will however be a smaller filesize than the old release. Feedback and bug reports, is as always appreciated. The demo/preview is located here: http://lovepeacenukes.com/tablesorter/2.0/tests/demo.html great news! one question: is paging supported ? micha -- POLYESTER* Wittstocksgatan 2 115 24 Stockholm Phone: 08-660 73 50 / +46-8-660 73 50 Mobile: 070-443 91 90 / +46-70-443 91 90 E-mail: [EMAIL PROTECTED] http://www.polyester.se
[jQuery] Re: Preview: Brand new tablesorter 2.0, multi-column sorting and more
Great point Stefan! Will be adding it shortly. /christian 2007/7/6, Stefan Petre [EMAIL PROTECTED]: May I suggest something? When you sort: first click sort ascending , second click sort descending ; third click clear sorting. 2007/7/6, tlob [EMAIL PROTECTED]: an ajax mysql connection for editing datas inside the table and I owe you BIG time! ;-) GREAT WORK!! On 6 Jul., 13:34, Christian Bach [EMAIL PROTECTED] wrote: 2007/7/6, Kia Niskavaara [EMAIL PROTECTED]: Multi-colum sorting is great news. Good work!! Reverse multisorting on one column and normal sorting on another column doesn't seem to be working (yet) Is it possible to add a custom sorter that sort using the initial order? Custom sorter will be supported in the same way as the old version did. I just updated the demo so the reversing on column won't revers all the selected columns and an options to append 500 rows of random data (for speed testing). http://lovepeacenukes.com/tablesorter/2.0/tests/demo2.html /christian -- POLYESTER* Wittstocksgatan 2 115 24 Stockholm Phone: 08-660 73 50 / +46-8-660 73 50 Mobile: 070-443 91 90 / +46-70-443 91 90 E-mail: [EMAIL PROTECTED] http://www.polyester.se
[jQuery] Re: Preview: Brand new tablesorter 2.0, multi-column sorting and more
Hi Andy, I will provide methods for clearing and resorting the table in the same way the update method works. Here is a example: $(table).tablesorter(); // new data has been appended to the table $(table).tablesorterUpdate(); // clear sorting $(table).tablesorterClearSorting(); /christian 2007/7/6, Andy Matthews [EMAIL PROTECTED]: Or better yet a clear sort button. That would be a bit more useful I think. -- *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Stefan Petre *Sent:* Friday, July 06, 2007 6:58 AM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: Preview: Brand new tablesorter 2.0, multi-column sorting and more May I suggest something? When you sort: first click sort ascending , second click sort descending ; third click clear sorting. 2007/7/6, tlob [EMAIL PROTECTED]: an ajax mysql connection for editing datas inside the table and I owe you BIG time! ;-) GREAT WORK!! On 6 Jul., 13:34, Christian Bach [EMAIL PROTECTED] wrote: 2007/7/6, Kia Niskavaara [EMAIL PROTECTED]: Multi-colum sorting is great news. Good work!! Reverse multisorting on one column and normal sorting on another column doesn't seem to be working (yet) Is it possible to add a custom sorter that sort using the initial order? Custom sorter will be supported in the same way as the old version did. I just updated the demo so the reversing on column won't revers all the selected columns and an options to append 500 rows of random data (for speed testing). http://lovepeacenukes.com/tablesorter/2.0/tests/demo2.html /christian -- POLYESTER* Wittstocksgatan 2 115 24 Stockholm Phone: 08-660 73 50 / +46-8-660 73 50 Mobile: 070-443 91 90 / +46-70-443 91 90 E-mail: [EMAIL PROTECTED] http://www.polyester.se
[jQuery] Preview: Brand new tablesorter 2.0, multi-column sorting and more
Hi, I put together a demo/preview for the upcoming release tablesorter 2.0release. The main features of the upcoming release will be: - Multi-column sorting - Robust support for adding new data to the table, provided with the new update method - Support for custom filter (thinks zebra tables etc) and support for writing your own in the same manner as parsers. However the upcoming release will NOT be back words compatible, as a have chosen to rewrite it from the ground up, it will however be a smaller filesize than the old release. Feedback and bug reports, is as always appreciated. The demo/preview is located here: http://lovepeacenukes.com/tablesorter/2.0/tests/demo.html Best regards Christian Bach
[jQuery] Re: Preview: Brand new tablesorter 2.0, multi-column sorting and more
2007/7/6, Kia Niskavaara [EMAIL PROTECTED]: Multi-colum sorting is great news. Good work!! Reverse multisorting on one column and normal sorting on another column doesn't seem to be working (yet) Is it possible to add a custom sorter that sort using the initial order? Custom sorter will be supported in the same way as the old version did. I just updated the demo so the reversing on column won't revers all the selected columns and an options to append 500 rows of random data (for speed testing). http://lovepeacenukes.com/tablesorter/2.0/tests/demo2.html /christian
[jQuery] Re: tableSorter - problems with changing the number of rows
Hi Phil, set useCache: false then trigger this after the update. $('#bodytable').trigger(updateColumnData); I'm addressing this issue in the new 2.0 version of tablesorter supplying a simple .update() method that will rebuild the cached table. And to leak a new feature: it will contain multiple column sorting. Best regards Christian 2007/7/5, Phil Glatz [EMAIL PROTECTED]: I'm using the tableSorter plugin and am having a problem with the number of rows displayed; I hope I can describe the situation clearly. I'm building my table dynamically from a local javascript array, initially populated with a database query. Next, I call the tableSorter function. So far so good. Next, I click a button to apply a filter. I clear out my table body's contents with $('#bodytable tbody').empty(); I fill it up again by looping through my data, but this time skipping certain rows, ending up with a smaller table. When I click on a column head to redisplay, it thinks I had the number of rows that were originally in the table, and doesn't sort correctly. It I have a filter on when I load the page and end up with 5 rows, then remove the filter and repopulate the table with ten rows, they all get displayed. But when I click to sort, only 5 rows are displayed. I want to avoid having to refresh the page, and am hoping there is something I can do to tell tableSorter to recalculate the table size after I have repopulated the table. I tried setting useCache to false, but that didn't help. I've tried calling $(#bodytable).tableSorter() again, hoping it would reset everything, but that didn't help either. Is there a way to force it to do a recalc? Thanks for your help, this is a great group. -- POLYESTER* Wittstocksgatan 2 115 24 Stockholm Phone: 08-660 73 50 / +46-8-660 73 50 Mobile: 070-443 91 90 / +46-70-443 91 90 E-mail: [EMAIL PROTECTED] http://www.polyester.se
[jQuery] Re: tableSorter - problems with changing the number of rows
.trigger(resort); /christian 2007/7/5, Phil Glatz [EMAIL PROTECTED]: On Jul 5, 4:22 am, Christian Bach [EMAIL PROTECTED] wrote: set useCache: false then trigger this after the update. $('#bodytable').trigger(updateColumnData); Thanks, Christian; that did the trick. When I rebuild the table with more rows, sorting isn't working. If I was sorting on a particular column, the new column contents don't always come out in sorted order. Is there another trigger to force a sort update? Thanks again, Phil -- POLYESTER* Wittstocksgatan 2 115 24 Stockholm Phone: 08-660 73 50 / +46-8-660 73 50 Mobile: 070-443 91 90 / +46-70-443 91 90 E-mail: [EMAIL PROTECTED] http://www.polyester.se
[jQuery] Re: outerHTML and Firefox does not work
You could try this, it's a bit sloppy but what the heck... $.fn.outerHtml = function() { $this = $(this); var h = $this.html(); var s = $this.wrap(div/div).parent().html(); $this.empty().html(h); return s; }; div id=A div id=B divhello/div /div div id=Chello2/div /div alert($(#B).outerHtml()); /christian 2007/4/10, Fabien Meghazi [EMAIL PROTECTED]: Correct. Only Internet Explorer supports outerHTML. Even innerHTML started off as a Microsoft only thing, but because it was used so widely other browsers have adopted it as a defacto standard. What are you trying to do that you need to use outerHTML? Hi everyone in this thead, I was about to ask the same question when I saw this thread. The problem is that no response has been given, so let me ask again : Is there a way to get the equivalent of outerHTML's result of a node using jQuery ? (Y/n) Got this: nodeA nodeB id=test nodeC/ /nodeB nodeD/ /nodeA I would like this $(#test).jquerymagic() to return this : nodeB id=test nodeC/ /nodeB Same behaviour than $.html() but including the node's tag html too. It's probably so basic that I must be blind and can't see the evidence. Please, open my eyes. Thanks. -- POLYESTER* Wittstocksgatan 2 115 24 Stockholm Phone: 08-660 73 50 / +46-8-660 73 50 Mobile: 070-443 91 90 / +46-70-443 91 90 E-mail: [EMAIL PROTECTED] http://www.polyester.se
[jQuery] Re: TableSorter question
tableSorter({ sortColumn: 0, sortDir: 1 }); Will sort the first column in the opposite direction. /christian 2007/4/9, Chris W. Parker [EMAIL PROTECTED]: On Monday, April 09, 2007 12:02 PM Andy Matthews said: There's an option for default sort. How is the data getting to the page? Is it hard-coded or the result of an SQL operation? It's both. I mean that it's not JSON or XML data. The data returned from the SQL call is used to create the table's HTML with PHP. Then TableSorter does its magic. Chris. -- POLYESTER* Wittstocksgatan 2 115 24 Stockholm Phone: 08-660 73 50 / +46-8-660 73 50 Mobile: 070-443 91 90 / +46-70-443 91 90 E-mail: [EMAIL PROTECTED] http://www.polyester.se
[jQuery] Re: TableSorter question
Sorry Chris, seems you found a bug. I checked in a new version that takes care of business. http://dev.jquery.com/browser/trunk/plugins/tablesorter/jquery.tablesorter.js?format=txt /christian 2007/4/9, Chris W. Parker [EMAIL PROTECTED]: On Monday, April 09, 2007 12:43 PM Christian Bach said: tableSorter({ sortColumn: 0, sortDir: 1 }); Will sort the first column in the opposite direction. Actually that just makes my arrow appear upside down. Here's what I see without sortDir set. Column up arrow April 9, 2007 April 10, 2007 April 11, 2007 Here's what I see with sortDir set to 1. Column down arrow April 9, 2007 April 10, 2007 April 11, 2007 Chris. -- POLYESTER* Wittstocksgatan 2 115 24 Stockholm Phone: 08-660 73 50 / +46-8-660 73 50 Mobile: 070-443 91 90 / +46-70-443 91 90 E-mail: [EMAIL PROTECTED] http://www.polyester.se
[jQuery] Re: TableSorter issues: special characters, mixed data
I checked in a new version that takes care of all the problems. I based my test case on your example, located here: http://lovepeacenukes.com/jquery/tests/tablesorter-mixed-data-types.html /christian 2007/4/6, Kim Johnson [EMAIL PROTECTED]: Err... I take that back. -the only way for the page to not have javascript errors is to put in the ExtractionType line, due to the special characters in the title. -however, by doing this, any time you sort any other field, it still is sorting by title, not the field you actually clicked. --- Kim Johnson [EMAIL PROTECTED] wrote: Super close, but not quite! :) http://anime-planet.com/users/reviewindex.php?usersid=1 $(#userreviewtable).tableSorter({ sortColumn: 'title', stripingRowClass: ['alt2','alt'], stripeRowsOnStartUp: true, textExtractionCustom: [ [2,'integer'] ], textExtractionType: ['title'] }); ExtractionType fixes the title issue -- those sort just fine now. I also changed the date to 4 digits and that works just fine (it didn't work with the date line you had mentioned for 2 digits). However, the Custom line still doesn't do anything for sorting the score field. (I removed the 0's, as normally those fields would be BLANK, as opposed to 0). I also tried changing [2, 'integer'] to 'decimal' or 'double', to no avail. Any ideas on this last tiny bit? thanks again, -kim --- Christian Bach [EMAIL PROTECTED] wrote: I took a look at your example page and this snippet will solve your problem: $(#userreviewtable).tableSorter({ sortColumn: 'title', stripingRowClass: ['alt2','alt'], stripeRowsOnStartUp: true, textExtractionCustom: [ [2,'integer'] ], dateFormat: dd/mm/yy }); What we are doing here is forcing the third column (we start counting at zero) to use the integer parser, since the column is messed up with the auto detection and identified as a text column (hey, no ones perfect). As regarding your date format 01/01/07 i have added this to the shortDate parser, however since the year is formatted with two digests the parser will parse 07 as 1997 since there is no way for it to know that you properly mean 2007. So my suggestion is to change this to a full 4 digit year format. If you do change the the year to a 4 digit format remove the dateFormat property from the tablesorter constructor. The new tablesorter version can be found here: http://dev.jquery.com/browser/trunk/plugins/tablesorter/jquery.tablesorter.js?format=txt Best regards Christian 2007/4/5, Kim Johnson [EMAIL PROTECTED]: Thanks Christian! I just pasted that in and indeed, now there isn't a JS error and it sorts correctly by title. However, now something strange is happening and the other fields don't sort -- they all sort by title! The date specifically is what I just tried. Here are two sample pages: http://anime-planet.com/users/reviewindex.php?usersid=19 ^^this page has always worked, because it has no special character names http://anime-planet.com/users/reviewindex.php?usersid=1 ^^the problem child page. The title does now work. Also, here's the tablesorter initialization: $(#userreviewtable).tableSorter({ sortColumn: 'title', stripingRowClass: ['alt2','alt'], stripeRowsOnStartUp: true, textExtractionType: ['title'] }); And one other question: is it possible to do multiple columns for textExtraction (using a comma, two separate lines for it, etc)? There is one other column (score) that in theory should be able to have either nothing, or a number. Note: I'm still down with helping you on the documentation front :) thanks! -kim --- Christian Bach [EMAIL PROTECTED] wrote: Kim, is it possible to publish a test page so i can take a look? A quick fix would be to use the new property textExtractionType - which in true tablesorter spirit is undocumented. Here is a example: This forces the tablesorter to extract data out of the title attribute, allowing a simple way to present mixed data to the user (string/numbers/etc). script $(table).tableSorter({ textExtractionType: ['title'] }); /script table thead tr thRow/th thNumber/th /tr /thead tbody tr td title=1One/td td title=3030.00/td /tr tr td title=22/td td title=50a href=50.000/td /tr /tbody /table Best regards Christian 2007/4/5, Kim Johnson [EMAIL PROTECTED]: Anyone know a workaround for this? :) Christian, any thoughts