EagleX Posted April 25, 2018 Share Posted April 25, 2018 I am planning to use an independent form or panel to search for a value in a selection list (instead of using a UniDBLookupComboBox). Once the value is selected, the grid is focused again. How can I copy the selected value into the uniDBGrid's cell so the new value is displayed in the grid? Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 25, 2018 Share Posted April 25, 2018 Hi, Can you please explain in more detail? Maybe you need this approach: DataSet.Edit; ... DataSet.Post; Best regards, Quote Link to comment Share on other sites More sharing options...
gutierrez42 Posted April 25, 2018 Share Posted April 25, 2018 Thank you. Probably a good example is the very old Delphi's MastApp application. There, you have an Order Form (uniDBGrid in this case), a PartNo must be entered (without using a combobox but opening a new dialog form to select a Part). So you select a Part Number, close the dialog form and the selected value is pasted into the cell of the grid. What I am looking for is a an alternative to searching items without using a UniDBLookupComboBox, as this is useful for a very specific list. I would use a panel or a new dialog form where more general list options are available. In the last step (when the panel or dialog form is closed) the selected value is replicated into the cell of the grid. How can I paste this selected value into the cell? Best regards. Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted April 25, 2018 Share Posted April 25, 2018 For the answer see #2. You must edit the DataSet. Quote Link to comment Share on other sites More sharing options...
adragan Posted April 25, 2018 Share Posted April 25, 2018 Simplest way : 1. From the search form , before closing you put the search result into a variable from UniMainModule. 2. Write a call back function from the search form that takes that variable from UniMainModule and puts it in the grid wherever you want. That is if I understood correctly what you asked. Quote Link to comment Share on other sites More sharing options...
EagleX Posted April 25, 2018 Author Share Posted April 25, 2018 Thanks for your help! I have found a previous topic that might be the closest answer to my dilemma: Update Grid Cell Clientside Delphi DeveloperPosted 12 May 2017 - 08:12 AM 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, Here, it is explained how to update a grid cell on clientside. I already have the "newvalue" and I need to display the new value on the cell. I am new to uniGUI so I do not know how to integrate this code into the Delphi Code, probably using a AddJS, but where? I have tried but a "grid not defined" message is generated on the browser. Thanks. Quote Link to comment Share on other sites More sharing options...
EagleX Posted April 25, 2018 Author Share Posted April 25, 2018 I am sorry, I have found the problem: var grid = MainForm.UniDBGrid1; was missing in my code. Thanks. 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.