filter with grid and subgrid

Questionsfilter with grid and subgrid
Robby asked 11 years ago

Dear sir,

I have a database with 2 tables.
To make it simple, imagine I have a table with family name + information (address, phone, …) and a second one with childrens.

I have a grid with my first table and a subgrid with childrens.
When I clic in family name, I open the subgrid to see all members of this family.
This is ok.

The question is, it is possible to put filters in the grid with fields coming from subgrid?

The target is to filter all family with a children named "John" for example.

Thanks for your reply.

Regards.

Rob

3 Answers
Abu Ghufran answered 11 years ago

Hello,

By default searching in grid works with it's data. Not in sub grid's data.
Alternate solution could be to have a JOIN in parent grid's SQL select_command, in which you select column (using GROUP_CONCAT function) to have all children names comma separated. And then apply contains search in that field in parent search dialog.

Robby answered 11 years ago

Hi,

Thanks for your reply.
I try GROUP function without success.
It works with PhpMyAdmin but but not with Grid module.

In PhpMyAdmin I've got all children by family.
With Grid module, I only have 1 (first one or last one according to my command).

It's strange.

Regards.

Rob

Abu Ghufran answered 11 years ago

Hello Rob,

You can email me code for review at [email protected]

Thanks

Your Answer

4 + 9 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?