eono Posted May 12, 2017 Share Posted May 12, 2017 Hi, How can I update the value of a particular cell of a row using Javascript on the client and still have the value submitted to the server on grid post? I have tried: store = frm.dbg.store r = getAt(0) r[0] = 'new value' r.commit() // at this point, the data shows in the grid When I do a save of the grid using the navigators save button, the new data entered, and displayed on the grid, is not saved to the server. Doing a normal data edit on the grid saves any grid changes. What am I missing? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 12, 2017 Share Posted May 12, 2017 Hi, Maybe like this ?: var grid = MainForm.UniDBGrid1; var edPlugin = grid.editingPlugin; edPlugin.startEditByPosition({ row: 0, column: 1 }); edPlugin.getActiveEditor().field.setValue("newValue"); edPlugin.completeEdit(); Best regards, 1 1 Quote Link to comment Share on other sites More sharing options...
eono Posted May 12, 2017 Author Share Posted May 12, 2017 Hi, Maybe like this ?: var grid = MainForm.UniDBGrid1; var edPlugin = grid.editingPlugin; edPlugin.startEditByPosition({ row: 0, column: 1 }); edPlugin.getActiveEditor().field.setValue("newValue"); edPlugin.completeEdit(); Best regards, Perfect! You the men. Lost some hair trying to get this to work. 1 Quote Link to comment Share on other sites More sharing options...
eono Posted May 12, 2017 Author Share Posted May 12, 2017 @DelphiDeveloper, This works, but it still has to contact the server :-( Can't I have a scenario where the server is not contacted until I click on the save button, when I am done processing? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 12, 2017 Share Posted May 12, 2017 This works, but it still has to contact the server :-( Yes, in any case, you need the server side to commit changes Can't I have a scenario where the server is not contacted until I click on the save button, when I am done processing? Of course, your changes will not be saved, until you don't commit on the server Sorry, maybe I did not quite understand you But, In any case, the grid needs connect to the server for some synchronization Quote Link to comment Share on other sites More sharing options...
eono Posted May 12, 2017 Author Share Posted May 12, 2017 Thanks for your prompt replies @delphideveloper I want a situation where it doesn't contact the server until I explicitly want it to. Say I need to process 5 columns for 4 rows, with this I will hit the server 20 times in total. What I want is to hit the server just once, when I am done and I click a button 'Save' on the grid's form. Is there no way to delay the grids synchronization until when saving or manually trigger the synchronization? Kind regards. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 12, 2017 Share Posted May 12, 2017 How will you change the data on the grid, all the changes at one "moment"? 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 12, 2017 Share Posted May 12, 2017 Ok I will analyze it Quote Link to comment Share on other sites More sharing options...
eono Posted May 12, 2017 Author Share Posted May 12, 2017 How will you change the data on the grid, all the changes at one "moment"? Using the code you provided, I can make the changes on the grid clientside. When I am done I can then click a button on the grids form and send all changes made to the grid to the server. Quote Link to comment Share on other sites More sharing options...
eono Posted April 25, 2019 Author Share Posted April 25, 2019 Hello @Sherzod, Back to this issue after 2 years!:-) Any updates on how to ONLY send the updates when I click a single button? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 25, 2019 Share Posted April 25, 2019 11 minutes ago, eono said: Hello @Sherzod, Back to this issue after 2 years!:-) Hello, Time goes by so fast... 16 minutes ago, eono said: Any updates on how to ONLY send the updates when I click a single button? Please remind the question once again... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.