Split Pane Data Grid No OnRecordSelect in groupBy mode

Forum to discuss the new web client version of Servoy.

Split Pane Data Grid No OnRecordSelect in groupBy mode

Postby pitc » Thu Oct 29, 2020 9:07 pm

I have Servoy 2020.9.0.3602
I am exploring capabilities of NG:
Created a form "T" with flex layout template.
In the flex-content section I place a row with single column.
In the single column I place a split pane.
In pane 0 (left) I specify a form A and in pane 1 I specify a form B. Both responsive forms.
Form A is defined with 1 row and 1 column. Inside the column I place a datagrid. Datasource is foundset "X".
Similarly form B specified the same way. Datasource is foundset "Y".
In the form T split pane I specify a relation between the panes as X.id->Y.x_id_fk.
So when I view the result by launching NGClient I see the X records in the left pane correctly.
The records in the right pane are the related records and shown correctly.
When I selected a different record from the left pane data grid the related records of Y are displayed correctly.
The onRecordSelection is called due to selecting each left pane record.
Issue:
If I group the X records by a column (e.g. date) the left pane groups correctly.
However, the related records in the right pane do not change when I select a left side record.
It appears that the related foundset is not updated due to selecting a different record inside the group. I checked and the onRecordSelection is not called.
So is this expected?
Should I design the form differently?
Tom
Tom
prospect-saas.com
pitc
 
Posts: 115
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Re: Split Pane Data Grid No OnRecordSelect in groupBy mode

Postby pitc » Fri Oct 30, 2020 4:09 am

Update:
On some more research I did find the onCellClick event which provides a little help.
It fires when user clicks on a cell in the DataGrid. The parameters give an indication if in grouping mode when foundsetindex is -1.
When in group mode, I use the record passed back to get the priamry key and perform a foundset.setSelectedRecord(primary key). This nicely forces some internal action and the relation fires and the related foundset is updated and now display correctly.

I thought I was done so testing some more I found that a second grouping (e.g. by country then by city) makes the foundset.setSelectedRecord fail! So now my workaround to fire the relation fails and the related foundset remains at the previous state.

In reading the wiki (https://github.com/Servoy/aggridcomponents/wiki/Data-Grid) it does not mention any issues with more than one grouping.
Tom
Tom
prospect-saas.com
pitc
 
Posts: 115
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Re: Split Pane Data Grid No OnRecordSelect in groupBy mode

Postby Gabi Boros » Fri Oct 30, 2020 5:18 pm

When rows are grouped, the grid does not shows anymore the form's foundset (this is why onRecordSelection is not called), but newly created foundsets for each group, foundsets that are created internally by the component. The record from onclick should be a record from the form's foundset, no matter how many grouping are used - so, is the record you pass to foundset.setSelectedRecord does not exist in the form's foundset?
Gabi Boros
Servoy
Gabi Boros
 
Posts: 402
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania

Re: Split Pane Data Grid No OnRecordSelect in groupBy mode

Postby pitc » Fri Oct 30, 2020 5:59 pm

Yes the record does exist - I checked the primary key and it is there.
Note that this only happens when the grouping is more than one item. For a single item it is working ok.
It appears that the relation I have between the panes is not triggered because (I conjecture) the setSelectedRecord fails.
Is there some place to find out the reason for the failure - not in the Servoy Admin Log.
Now if this is a limitation I am looking for a workaround.
I suppose I could re-design by not using a split pane and a relation between the panes. Perhaps do a query to get all related records from all the tables and submit that dataset to the DataGrid.
Tom
prospect-saas.com
pitc
 
Posts: 115
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Re: Split Pane Data Grid No OnRecordSelect in groupBy mode

Postby Gabi Boros » Mon Nov 02, 2020 9:23 am

I don't really see how multi-grouping could cause this, because as soon as you get the record from the grid, and that seems a valid record, you do the same, as when single grouping is applied, and just call the same setSelectedRecord ...
so the grid should not have any influence. Does it work if you select the same record in single grouping and also in multigroup? Are any errors in the log? You could upload your sample here or in our support system( http://support.servoy.com ), so we can debug it.
Gabi Boros
Servoy
Gabi Boros
 
Posts: 402
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania

Re: Split Pane Data Grid No OnRecordSelect in groupBy mode

Postby pitc » Mon Nov 02, 2020 4:27 pm

I will look into why the selectRecord fails when the current record is same as the record passed in on the onCellClick event from the grid.
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 5 guests