3.0 beta 2

action after sorting

I have an ordinary grid containing data. When you click on the header of a given column, the grid is sorted.

How can I make some action happen after sorting? For instance, after clicking a column header and sorting the grid, pop up an alert that says "You just sorted the grid."

- ej
ericj
October 31,
You can use onHeaderClicked event + timeout

obj.onHeaderClicked = function(event, col){
        this.setTimeout(function(){
            alert(col + " " + this.getSortDirection(col));
        });
    }


Alex (ActiveWidgets)
October 31,
Alex:

In the above example I would set a timeout to initiate an action after the header was clicked.

I need to be certain that the grid is done sorting before my action happens.

How might I do that?

- ej
October 31,
In all current browsers the javascript runs in a single thread. When you set a timeout to run an action - it is guaranteed to run after the current script ends (i.e. sorting is completed).
Alex (ActiveWidgets)
November 1,
Thank you very much.
November 1,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.