Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Amb on Mar 03, 2009 03:11
open dhtmlx forum
HTML select filters on grid

Hi,

Using the HTML select filters, currently the blank entry means "no filtering". Is it possible to change this so we have a dummy "All" value instead, and have the blank entry really mean "those rows where the value of the cell is actually blank"?

Thanks,
Answer posted by Support on Mar 03, 2009 05:29
>> Is it possible to change this so we have a dummy "All" value instead

Can be done only by code modification
dhtmlxgrid_filter.js 
dhtmlXGridObject.prototype._loadSelectOptins=function(t,c){ 
        var l=this.collectValues(c);
        t.innerHTML="";
        t.options[0]=new Option("","");

can be replaced with 

        t.options[0]=new Option("All","");

>>and have the blank entry really mean "those rows where the value of the cell is actually blank
mygrid.attachEvent("onFilterStart",function(a,b){
    if (a[INDEX]=="") a[INDEX]=function(val){ return val==""; }
    return true;
});
where INDEX - index of column in which select filter used