DataGrid Error in grouped Mode - onSelectedRowsChanged miss

Forum to discuss the new web client version of Servoy.

DataGrid Error in grouped Mode - onSelectedRowsChanged miss

Postby willi.weiger » Thu Apr 04, 2024 11:47 am

I get this error when I change the selected item in a datagrid. I assume thats why I do not get the event onSelectedRowsChanged.
The onCellClick event works.

ERROR org.sablo.BrowserConsole - TypeError: Cannot read properties of undefined (reading 'length')
at DataGrid.onSelectionChangedEx (http://localhost:8183/default-src_ngcli ... :142829:70)
at http://localhost:8183/default-src_ngcli ... :142807:14
at http://localhost:8183/default-src_ngcli ... :139890:28
at timer (http://localhost:8183/polyfills.js:2444:27)
at _ZoneDelegate.invokeTask (http://localhost:8183/polyfills.js:529:171)
at http://localhost:8183/vendor.js:29844:49
at AsyncStackTaggingZoneSpec.onInvokeTask (http://localhost:8183/vendor.js:29844:30)
at _ZoneDelegate.invokeTask (http://localhost:8183/polyfills.js:529:54)
at Object.onInvokeTask (http://localhost:8183/vendor.js:30158:25)
at _ZoneDelegate.invokeTask (http://localhost:8183/polyfills.js:529:54)
WARN org.sablo.BrowserConsole - 11:37:24 WARN DataGrid - select grouped record not supported yet
willi.weiger
 
Posts: 7
Joined: Mon Apr 03, 2023 2:10 pm

Re: DataGrid Error in grouped Mode - onSelectedRowsChanged m

Postby Gabi Boros » Thu Apr 04, 2024 12:57 pm

Which version of Servoy and NG Grids do you use? If you're not using the latest NG Grids, do you see the issue also if you update it to the latest in the Servoy Package Manager?
Gabi Boros
Servoy
Gabi Boros
 
Posts: 404
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania

Re: DataGrid Error in grouped Mode - onSelectedRowsChanged m

Postby willi.weiger » Thu Apr 04, 2024 2:06 pm

I am using Servoy version 2023.12.2.3924 with the latest NG Grids 2023.12.2.
willi.weiger
 
Posts: 7
Joined: Mon Apr 03, 2023 2:10 pm

Re: DataGrid Error in grouped Mode - onSelectedRowsChanged m

Postby Gabi Boros » Thu Apr 04, 2024 2:20 pm

it seems this is the same as reported here: https://support.servoy.com/browse/SVY-18960
it is fixed in 2024.3
Gabi Boros
Servoy
Gabi Boros
 
Posts: 404
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania

Re: DataGrid Error in grouped Mode - onSelectedRowsChanged m

Postby willi.weiger » Fri Apr 05, 2024 10:50 am

Thanks Gabi,
I tested it now with version 2024.3 and it worked.
To get the selected in grouped mode I use the function getGroupedSelection() of the grid - but how do I know that the grid is in grouped mode?

Another problem that I recognized is that the event OnSelectedRowsChanged() is not fired if I filter on a column.
willi.weiger
 
Posts: 7
Joined: Mon Apr 03, 2023 2:10 pm

Re: DataGrid Error in grouped Mode - onSelectedRowsChanged m

Postby Gabi Boros » Fri Apr 05, 2024 1:43 pm

to check if there is a grouping in the grid, you need to look into the column state:
Code: Select all
   var columnStateObj = JSON.parse(elements.groupingtable_1.getColumnState());
   for(var i = 0; i < columnStateObj['columnState'].length; i++) {
      if(columnStateObj['columnState'][i].rowGroupIndex !== null) {
         application.output('grouped');
         break;
      }
   }

I did a quick check, and onSelectedRowsChanged is called on my side even if I filter a column using NG Grid's column filter;
if it is not working in your solution, you should create a case in our support system ( https://support.servoy.com/ ) with a sample
Gabi Boros
Servoy
Gabi Boros
 
Posts: 404
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 1 guest

cron