Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Nico on Feb 20, 2008 02:43
open dhtmlx forum
Filter date between date from and date to

Dear all,

Is it also possible to filter a "date" field
With two textboxes.
"Date from" and "date to"

So the return value are the date's between the two values of the textboxes.

Thanks in advanced.

Yours,

Nico
Answer posted by Support on Feb 20, 2008 05:31
You can define custom filtering function

var data_from=document....
var data_to=document....

grid.filterBy(index,function(val){
    if (val>data_from && val<data_to) return true;
    return false;
};

Answer posted by John-O on Apr 14, 2008 06:36
Where do you make this custom function? Is there a working sample of this available?
Answer posted by Support on Apr 14, 2008 06:47
There is no online sample of date filtering, but the usage of function as parameter of filterBy can be checked at
    http://dhtmlx.com/docs/products/dhtmlxGrid/samples/filtering/pro_filter.html?un=1208181743000

The second parameter of filterBy command may be a value , or function which will be called against all values in related column.