Search and Filter does not filter with child grids/tables when using detailInit()

2 Answers 35 Views
Filter Grid
George
Top achievements
Rank 2
Iron
Iron
Iron
George asked on 24 Oct 2023, 05:09 PM

Hi,

Need to understand how I can get the filter and search features for the Kendo grid to search for strings in child grid rows as well as the parent grid rows... right now if I use the Search window, or the Filter feature at the parent level, the Kendo grid will only search in the domain/area of the parent rows.

 

How can I include the child rows? This is problematic because, as I understand it the child rows are not loaded until the user clicks the left side triangle icon to open the child rows. Customer wants this.

My understanding is this would require all the child rows to rendered... then searched, and all rows with out the string or or substring would be filtered out?

Before I embark on manipulating the grid, wondered if there was a better solution or way to go about this?

Regards,

George

2 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 27 Oct 2023, 09:59 AM

Hello, George,

The search panel is intended to loop through the parent Grid only. A possible approach would be to manually filter the child Grids based on the value in the search input. However, the parent row needs to be expanded as otherwise the child Grid will not be initialized at all and there will be no component to filter. 

Another course would be to review the TreeList as it has similar functionalities to the Grid, and supports hierarchy filtering.

Let me know if the above information would be helpful.

Regards,
Martin
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
George
Top achievements
Rank 2
Iron
Iron
Iron
commented on 27 Oct 2023, 02:29 PM

Martin,

Hi...

Right now, I am interested in preserving the work I did on the hierarchical grid.

(Q1) So could I capture an event in the existing kendo search box, or would I have to create my own search box?

I envision the Search box firing off an event every time there is a keystroke down...

that is to say, I would be listening for a keystroke down or up ....

that would:

(1) filter the data source with only the child rows that have the substring, while preserving its parent.

(2) populate, and expand the parent rows and child rows, then rendering the rows containing the given substring.

(3) it would also search the parent rows for the substring, second...so if that substring existed only in the parent row(s) it would be rendered by itself.

Then every time a new character is entered, the event handler would capture the new substring, then re-render the entire grid. I guess that's the way I would need to handle that(?)

I am not sure there is a change event handler specifically for the search box, either

Thanks!

George

0
George
Top achievements
Rank 2
Iron
Iron
Iron
answered on 31 Oct 2023, 07:57 PM

So here is a Kendo UI Dojo link:


of what I did so far... this would be a really nice feature, to be able to search the detail child grids, The way I did it was very specific to the problem but a more "generic" solution would be really cool. hint, hint wink wink. :)

Untitled | Kendo UI Dojo (telerik.com)

I have included a text file with the code in it...if the Dojo page disappears.

 

Thanks,

George

Martin
Telerik team
commented on 01 Nov 2023, 11:48 AM

Hello, George, 

Thank you so much for sharing your solution, it would definitely be beneficial for the rest of the community!

Currently, the parent and child Grids share no relation when it comes to their data, as the child Grid is being added through a template. In order to deliver the functionality out-of-the-box, we would need to integrate a hierarchical dataSource. Nevertheless, we will keep our eyes open to track the demand towards such a feature.

Tags
Filter Grid
Asked by
George
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Martin
Telerik team
George
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or