DHTMLX Docs & Samples Explorer

Index
dhtmlxgrid
Event Handling

## onBeforeSorting Event

Required library edition:

This event occurs before starting data sorting. onBeforeSorting event passes the following parameters:

- column index
- sorting type (“str”,”int”,”date”)
- direction of sorting (“asc”,”des”)

Event is blockable (if custom code, attached to event, returns value different from true - sorting operation will be blocked)

            grid.attachEvent("onBeforeSorting", function(ind,type,direction){
                  //any custom logic here
                  return false;
            });