Skip to main content

sorting yahoo datatable

1 reply [Last post]
Joined: 2008-02-02

Hi there,
I want to call the servlet using doAjax when I click on the column title instead of the default sorting provided by jmaki. Is there any way to do this?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-07-31

Right now we don't have a way to expose this in a generic way when it comes to sorting.

It could be done with a little work in the /yahoo/dataTable/component.js where you could add an doAjax call from the sorting .

The code you can look at is around line 90:

// sort function for the providing assending sort for adding items.
function gSorter(a, b, desc) {
var comp =;
var myComp = comp(a.getData(cols[0].key), b.getData(cols[0].key), false);

return myComp;

where you would would pre-make a call and then base sorting on the results.

Hope this heps,