Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by dian.kwok on Nov 09, 2008 23:41
open dhtmlx forum
Custom Filter in Grid

Hi Team,

I am making a custom filter at the grid header as below:

<afterInit>
<call command="attachHeader">
        <param><![CDATA[
                <input type='text' name='Filter1' onclick='(arguments[0]||event).cancelBubble=true;'
onblur='reloadGrid();' style='width:90%; font-size:8pt; font-family:Tahoma;' /> ,
<input type='text' name='Filter2' onclick='(arguments[0]||event).cancelBubble=true;'
onblur='reloadGrid();' style='width:90%; font-size:8pt; font-family:Tahoma;' />                 
             ]]>
        </param>
</call>

</afterInit>

The filter is using server side.

The problem is when i reload the grid after filtering, the filter state is gone. My purpose is having the grid result based on more than 1 filter fields.
Is there any way i can hold the filter state?

Thanks in advance.

dian
Answer posted by Support on Nov 10, 2008 02:29
Which code your are using for grid reloading ?
If you are using something similar to the 
    grid.clearAll();
    grid.loadXML(url?filter="+some);
tnen be sure that url returns only data part of grid without head section of grid. If response will contain head section it will cause grid re-initialization, which will result in filter state lost. 
If only data will be returned then grid will maintain its state. 
Answer posted by dian.kwok on Nov 10, 2008 19:42

Hi thanks for the answer. It works great after i exclude the head section when reload the grid ;)

Thank you.

dian