Data Grid - onColumnDataChange timing issue

Forum to discuss the new web client version of Servoy.

Data Grid - onColumnDataChange timing issue

Postby qhill » Thu Nov 30, 2023 7:32 pm

We are using version 2022.3.6 of Servoy NG Grids and are on 2022.03.4 LTS.

We are using onColumnDataChange to validate data and if I have two rows and am editing the last field in the first row and hit tab, it changes the selected record before running onColumnDataChange. onColumnDataChange then runs but it is now looking at the second row, not the one I just modified.

Best way to sort this issue?
qhill
 
Posts: 4
Joined: Wed Jan 08, 2014 9:07 pm

Re: Data Grid - onColumnDataChange timing issue

Postby sean » Thu Nov 30, 2023 9:50 pm

How do you obtain the record that was edited? Are you using the record object that was passed into the event?
https://docs.servoy.com/reference/servo ... datachange

Or do you then call getSelectedRecord in the data change event handler?
(it could be that the recording index has already changed, because that onRecordSelection is more like AFTER-record-selection)

Best,
Sean
Software Engineer
Servoy USA
sean
 
Posts: 367
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: Data Grid - onColumnDataChange timing issue

Postby qhill » Thu Nov 30, 2023 10:36 pm

Thank you! The getSelectedRecord was the issue. I swapped it to getting the record via the index passed into the event and it works perfectly.
qhill
 
Posts: 4
Joined: Wed Jan 08, 2014 9:07 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 1 guest