Hello,
We are using iGTreeGrid to display data in Parent-Child format.
We have one textbox on top of Grid and when I type few letters, it should filter the grid based on text enter in search box.
I have tried to use filter method as below of datasource but it is only filtering Parent rows but not filtering child rows data.
Ex. root.dataSource.filter([{fieldName : "_Column1", expr: "Cli", cond: "contains"}], "AND", true)
Can you please suggest any other way to filter the data ?
-
Devang
Hello Devang,
I am glad that you were able to achieve your requirement.
Thank you for using Infragistics components.
Regards, Monika Kirkova, Infragistics
Hey, I have resolved above issue just after posting this.
He Monika, Thank you for your reply.
I have tried your suggestion but it is giving me below error.
Uncaught Error: cannot call methods on igTreeGridFiltering prior to initialization; attempted to call method 'filter'
After investigating this further, I have determined that the igTreeGrid could be filtered instead of the dataSource. By using the filter method of the igTreeGrig Filtering feature both the parent rows and the child rows are being filtered.
function filterTreeGrid() {
$("#treegrid").igTreeGridFiltering("filter", ([{ fieldName: "firstName", expr: "a", cond: "contains", logic: "AND" }]));
}
However, the Filtering feature should be enabled and the filter row at the top of the grid is displayed. If this row should not be visible, display:none could be set to the .ui-iggrid-filterrow class:
<style>
.ui-iggrid-filterrow {
display: none;
</style>
Below I am attaching a sample demonstrating the described behavior. Please test it on your side and let me know if you need any further information regarding this matter.
igTreeGridFiltering.zip