hi
we have a tree grid that has most of its items on the top level (like a normal grid) but a few items have sub children (only 1 level down).
we have added filters to the columns and notice that when we type in a criteria it finds the normal grid rows, the sub children, but does not even look at the items that are classed as parents
we need the functionality for the user to type in a criteria and it looks at all items in the tree grid (normal grid rows, parent items, and level 1 children).
can you tell us how to do this please, or if not possible can you help us with a work around
thanks
You can use mygrid.setFiltrationLevel(-2) method which allow you to filter at all levels
thanks for this.
we have placed the code just after the filters have been added, as follows:
grid.attachHeader(",#text_filter,#text_filter,#select_filter,#text_filter");
grid.setFiltrationLevel(-2);
but we get the following error }},500)}};if (id.parentNode)id.parentNo…[0].tagName.toLowerCase()){case “input”:
thanks
According to above code you calling the command from XML, right?
Please be sure to place command in “afterInit” section
thanks, we placed this in the afterinit section
it displays some strange behaviour though
the values a parent is tb_33 for example then all of its children have tb_33a etc… and when we type ‘tb_’ into the filter box then it works fine as it places the parent node first then all children come after it. however if we type just ‘tb’ (without the underscore) then it shows all sub children first and then the parent at the bottom
is this a bug?
thanks
also, it doesnt filter on tree items that are not open
thanks
also, it doesnt filter on tree items that are not open
Known issue , if you are using smartXMLParsing mode
You can disable such mode , or add custom code to onOpenEnd event, which will call grid.filterByAll() to reapply filtering to newly rendered branch.
it displays some strange behaviour though
Unfortunately issue can’t be reconstructed locally. If it still occurs for you - please provide a sample of data ( xml ) for which issue occurs.
In normal case , filtering must not change order of parent|child elements, just change their visibility.
sorry i dont understand what you mean by:
>> or add custom code to onOpenEnd event,
which will call grid.filterByAll() to reapply filtering to newly
rendered branch.
this means that they still have to open the nodes though right?
“onOpenEnd” event raised immideatly after item in tree got command to open/close , and before item was opened//closed. Event also raised for unclosable nodes and nodes without open/close functionality - in that case result of function will be ignored.
so in the case of this problem, what code do i need to add in order to get it to also filter by un-opened nodes? i would appreciate an example as i am confused
thanks
or add custom code to onOpenEnd event, which will call grid.filterByAll()
You can use code as
grid.attachEvent(“onOpenEnd”,function(){
this.filterByAll();
return true;
})
as result, each time, after branch opening, filtering will be reapplied ( all #text_filter, #select_filter and etc. ) , so newly opened branch will be filtered same as all treegrid