DHTMLX Docs & Samples Explorer

SortInterface Object

add

adds a new sorting rule to collection

$coll->add("name","type");

Parameters:

  • name - name of the field.
  • type - sorting type: ASC or DESC

clear

clears collection (deletes all specified sorting rules).

$coll->clear();

Parameters:

  • none.

index

check if there are some rules in collection for the specified field and returns related hash.

$index = $coll->index("name");

Parameters:

  • name - name of the field

Returns:

  • true - if collection contains rule(s) for the specified field.
  • false - if collection doesn't contain any rules for the field.

rules

array of all specified sorting rules.

$name = $coll->rules[0]["name"];
$coll->rules[0]["direction"]="DESC";

Properties:

  • name - name of related field
  • direction - direction of sorting