Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ravindra Deoray on Jun 02, 2009 07:45
open dhtmlx forum
Grid filter for XML based configured grid

I am using Grid with XML based configuration like following

<rows>
<head>
<column width="30" type="sub_row" color="" sort="na" align="left"></column>
<column width="70" type="link" color="" sort="int" align="left">Incident Id</column>
<column width="120" type="txt" color="" sort="str" align="left">Category</column>
...
<settings>
<colwidth>px</colwidth>
</settings>
</head>
<row>
...

I want to enable filters and from documentation I see that I need to call mygrid.attachHeader(..) where mygrid is javascript grid object instance.

It work for first time. but when I refresh grid (after calling mygrid.loadXML(..) from second time onward, i dont see filters.

Is there a way to configure filters from XML configuration?

Ravindra
Answer posted by Support on Jun 02, 2009 07:53
>>but when I refresh grid (after calling mygrid.loadXML(..) from second time onward
If XML contains head section - it will cause grid reconfiguration, and all previously defined headers will be cleared.
Basically you can load grid with "head" section for initial data loading, and reload with xml without "head" section - in such case you will need not any extra code.

>>Is there a way to configure filters from XML configuration?
You can use 

<settings> 
<colwidth>px</colwidth> 
</settings> 
<afterInit>
        <call command="attachHeader"><param>a,#text_filter,c,d</param></call>
</afterInit>

</head>