jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Filter / search nested grids
Tagged: filtering, nested grid, searching
This topic contains 4 replies, has 2 voices, and was last updated by Peter Stoev 10 years, 3 months ago.
-
Author
-
Hi,
I’m using nested grids, how can I filter over the nested grids as well ?!!I need to have a search input field, generic one, so that when I write any text that may match any cell either in the main level or any of its n-levels, it can retrieves it. Is it possible ??
Note: After filtering I still have to display it as nested even if the matching cell is in one of the n-levels, because I have drag functionality which is applied only on the main level.
for ex.
| First Name | Last Name | age
_______________________________________
> | John | Alex | 20
————————————–
Car ID | Car Color
___________________
J1 | Red
——————-
J2 | Blue
————————————–
> | Frank | Dan | 30
————————————–
Car ID | Car Color
___________________
F1 | Black
——————-
F2 | White… and so on.
So if I write in the search “white”, I need to display the result as :
| First Name | Last Name | age
_______________________________________
> | Frank | Dan | 30
————————————–
Car ID | Car Color
___________________
F1 | Black
——————-
F2 | WhiteOR as:
| First Name | Last Name | age
_______________________________________
> | Frank | Dan | 30
————————————–
Car ID | Car Color
___________________
F2 | WhiteThanks in advance.
Regards,
BassantHi Bassant,
Unfortunately, we do not have such functionality in jqxGrid. The Filtering is applied on the Grid. Nested Grids are within Row Details and in general the parent Grid does not know and does not care what content is displayed within the Row Details. It filters the Cell Values only. In your scenario, you will probably have to write some custom code, create filter objects and apply them to your Grid and Nested Grids with API function calls.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
Okay, I have no problem, but it is doable, right ?
I’ll have to:
1- create a custom filter.
2- loop on ALL the cells (main & nested) and evaluate this filter with each.
3- keep track of the results and their relations with each other.
4- update the grid’s source again.But wouldn’t that affect the performance ?!! I think it will be killed
Taking into consideration that normally now I already have a performance issue on updating the grid it takes about 6 – 8 secondsThanks in advance.
Regards,
BassantOh no, you mean instead of step 2, I can use “applyFilters”, but how should I know the nested grids ??? I only get them one by one in the “initrowdetails”!
So how can I do it ?
Thanks in advance.
Regards,
BassantHi Bassant,
You can get the nested Grid Elements within the initrowdetails. And yes, to apply filters, use applyfilters method.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.