data grid master detail with grouping

Forum to discuss the new web client version of Servoy.

data grid master detail with grouping

Postby pitc » Tue Nov 02, 2021 4:57 am

Excuse me if this has been answered before now - but I cannot find it.
Use case:
I want a master - detail using NG data grids with the requirement that the master have a grouping (one or more).
The user opens a grouping and selects a record.
The detail grid should be populated via a relation between the master and the detail.
What I get:
On the first load of the master (has the form foundset) the detail is correct showing the records via the relation.
Note that the relation is on multiple pks.
When the master grouping is opened and a record selected that is different than the first time loaded the detail grid does not change.

I investigated the form onRecordSelected event of the master - not fired after the initial load.
I investigated the grouping table event onSelectedRowsChanged - fires
I investigated the onCellClick of the master grid fires and I can retrieve the record which represents the different selection and therefore get the pks of the master.
The master foundset is not changed, so I try to force by doing a foundset.selectRecord(pk1, pk2, pk3 etc).
Then I do a foundset.getSelectedRecord() and it has not changed. Therefore the relation is not fired.

Any hints are welcomed.
Tom
prospect-saas.com
pitc
 
Posts: 115
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Re: data grid master detail with grouping

Postby Gabi Boros » Tue Nov 02, 2021 9:32 am

Keep in mind, when the grid is in grouping mode, for each group a new foundset is created - so when you select a record in grouping mode you won't change the grid's foundset selection.
I see that you're getting the pks from the clicked record in oncellclick (when you're in grouping mode) and you set the selected record of the grid's foundset using those ... that should work fine,
and I expect that this should change the detail grid (that is a related foundset ) - if it's not the case, you should create a case so we can check this issue
Gabi Boros
Servoy
Gabi Boros
 
Posts: 399
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania

Re: data grid master detail with grouping

Postby pitc » Tue Nov 02, 2021 5:56 pm

When I do
Code: Select all
var isOk = foundset.selectRecord(pk1, pk2, pk3 etc).

the result is false. Therefore the foundset is not changed and therefore the relation not fired.
I will check again but the values of the pks come from the selected record passed back in the onCellClick event so theoretically should be correct.
Tom
prospect-saas.com
pitc
 
Posts: 115
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 3 guests

cron