SetFilterSort method


Automatically executes one of the two operation of filter and sort, or both;
It's called, into the reported examples by the help page.

   Sintax

ErgoDataGrid.SetFilterSort (arrFilter , sort)


   Parameters

arrFilter   Array with the variables that determine the filter for every column, in the form:
[[data_field_index , criterion , filter_value] , [...] , ...]

data_field_index: integer with the index of the field that determines the filter, contained in the server array $ArrayFilter, declared in the php file indicated by dataUrl;

criterion: integer which determine the rules that enstabilish what criterion worth for the filter; its value is one of that reported in the list on end.
0 = "equal to"
1 = "different from"
2 = "bigger than"
3 = "bigger equal than"
4 = "smaller than"
5 = "smaller equal than"
6 = "included between"
7 = "not included between"
8 = "that starts for"
9 = "that doesn't start for"
10 = "that ends with"
11 = "that doesn't end with"
12 = "that contains"
13 = "that doesn't contain"
14 = "empty"
15 = "not empty"
   (values valide for columns of types string or image, as declared in ArrayGrid)

0 = "equal to"
1 = "different from"
2 = "bigger than"
3 = "bigger equal than"
4 = "smaller than"
5 = "smaller equal than"
6 = "included between"
7 = "not included between"
8 = "empty"
9 = "not empty"
   (values valide for columns of types number or date, as declared in ArrayGrid)

16 = "true"
17 = "false"
   (values valide for columns of type boolean, as declared in ArrayGrid)

filter_value: string, number or date that represent the value given to the filter for the grid column and the criterion enstabilished in the two previous parameters; for the data type fields, follow the indications on theuse of the value that indicate a date in the filter



Example

This example says to ErgoDataGrid to filter the forth field (car registration date) of the "Cars" grid to visualize only the rows where its value is greater than the day of today less three year;
the resulting rows order is: ascending order for the field with index 0 ( "A0", see firstSort for the "ordering" string assegning rules)

var d=new Date();
opener.Cars.SetFilterSort([[4,2,d.getDate()+"/"+(d.getMonth()+1)+"/"+(Number(d.getFullYear())-3)]],"A0");