dhtmlxconnector:beforesort_event [DHX documentation]

PHP Connector DHTMLX

beforeSort

The event occurs before data loading and allows to customize sorting of dataset

$conn->event->attach("beforeSort",handlerFunc);

Parameters handlerFunc:

  • $sort_by - SortInterface object

Availability:

  • Available for Grid, Treegrid

Sample:

function custom_sort($sorted_by){
   $sorted_by->rules[0]["name"]="LENGTH(some_field)";// SORT BY LENGTH(some_field)
}
$conn->attach->event("beforeSort","custom_sort");