HtmlTable

19 views
Skip to first unread message

mmjaeger

unread,
Nov 7, 2009, 12:19:42 AM11/7/09
to MooTools Users
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

mmjaeger

unread,
Nov 8, 2009, 12:25:19 AM11/8/09
to MooTools Users
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?

mmjaeger

unread,
Nov 8, 2009, 1:00:41 AM11/8/09
to MooTools Users
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">???

mmjaeger

unread,
Nov 8, 2009, 10:35:10 AM11/8/09
to MooTools Users
Still struggling with the table sort - I downloaded the latest
HtmlTable.Sort.js from github - this took care of the error message:
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


However, upon loading the page, the sort classes that get applied to
the table header are applied twice - firebug shows me this: "<th
class="txtR asc desc">"

clicking on the date column does some stuff to the table but the date
column is not doing anything?

Hope somebody has an idea how to fix this as my client awaits his new
page.

mmjaeger

unread,
Nov 10, 2009, 11:38:02 AM11/10/09
to MooTools Users
any idea when to expect a fix for this if it is a bug at all - my
customer is getting kind of un-patient - sorry for bumping.

Aaron Newton

unread,
Nov 11, 2009, 1:19:55 PM11/11/09
to mootool...@googlegroups.com
I can try and get to this today. Why not diagnose and fix the problem
yourself and the push the fix back into the project? I'm not the only
one here who knows JavaScript.

-Aaron

Sorry for any typos. Big fingers , tiny buttons.

mmjaeger

unread,
Nov 11, 2009, 1:31:24 PM11/11/09
to MooTools Users
Thanks Aaron
I was afraid that I did something wrong - by the way, are there any
plans for adding paging as well?

On Nov 11, 10:19 am, Aaron Newton <anut...@gmail.com> wrote:
> I can try and get to this today. Why not diagnose and fix the problem  
> yourself and the push the fix back into the project? I'm not the only  
> one here who knows JavaScript.
>
> -Aaron
>
> Sorry for any typos. Big fingers , tiny buttons.
>

Aaron Newton

unread,
Nov 11, 2009, 4:50:41 PM11/11/09
to mootool...@googlegroups.com
sure, if you write it.
Reply all
Reply to author
Forward
0 new messages