Jump to content

Copying a selected value into a uniDBgrid's cell


EagleX

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Thanks for your help!

 

I have found a previous topic that might be the closest answer to my dilemma:

Update Grid Cell Clientside Delphi Developer

Posted 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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...