I've a column in my table with file sizes like: 985.01 kb 1.2 mb 42 kb ....
the number parser doesn't work on these kind of numbers I guess we need some other parser for these kind of numbers found something that might help - I'll give it a try here is what I got: if(type == "KB") value = value*1024; else if(type == "MB") value = value*[Math.pow(1024,2)]; else if(type == "GB") value = value*[Math.pow(1024,3)]; else return "error"; sorting on a "string" column works - the date colum I have fails totally - I'm just getting a white area where the table was. another issue I'm experiencing is that the column header that get's sorted upon loading of the page has both css classes applied like: <th class="txtR asc desc">??? On Nov 7, 9:25 pm, mmjaeger <[email protected]> wrote: > got a little further - the sort script seems to do something but I'm > getting the following error: > > this.get("text").format is not a function > [Break on this error] });this.sortSpans.empty > ();this.sortEnabl...e.parse(this.get("text").format("db"));\n > > am I still doing something wrong? > > On Nov 6, 9:19 pm, mmjaeger <[email protected]> wrote: > > > > > Hello > > I wanted to give the table sort a try but I can't get it to work - I'm > > not getting any error but the sorting just never occurs - I must be > > missing something: > > > setTableSort: function() { > > var el = $('tblDownload'); > > if ($defined(el)) return false; > > var table = new HtmlTable(el, { > > sortIndex: 1, > > parsers: ['string', 'string', 'numberLax', 'date'], > > classHeadSort: 'expand', > > classHeadSortRev: 'collapse', > > sortable: true, > > onSort: function() { > > console.log('done sorting'); > > } > > }); > > > table.sort(2, true); > > } > > > Thanks
