:: Forum >> Version 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
Tuesday, October 31, 2006
You can use onHeaderClicked event + timeout

obj.onHeaderClicked = function(eventcol){
        
this.setTimeout(function(){
            
alert(col " " this.getSortDirection(col));
        });
    }
 
Alex (ActiveWidgets)
Tuesday, October 31, 2006
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
Tuesday, October 31, 2006
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)
Wednesday, November 1, 2006
Thank you very much.
Wednesday, November 1, 2006



This topic is archived.

Back to support forum

Forum search