I have a grid called myGrid. The column A of myGrid is a lookup that shows 2 values: the code, and the description. I would like to copy the selected item's description into a second column of myGrid.
What would be the best way to do this?
I have a grid called myGrid. The column A of myGrid is a lookup that shows 2 values: the code, and the description. I would like to copy the selected item's description into a second column of myGrid.
What would be the best way to do this?
I have encountered this sometimes ago and the solution I found is a bit complicated but works fine. I had to create a form from scratch which is currently used in the lookup. When calling the form in the lookup() method, don't forget to put "element" in the arguments.
In the init method of the new form, use element.selectMode(YourTable.Code)
to specify which field will be selected. Override the closeSelect()
method of the new form and make it call a parm method located in the caller form. This parm method will set the YourTable.Description
field of the current record. Send the Description
related to the record from YourTable
selected by the user in the lookup.
The new form should be a window of type Popup, with the toolbar hidden and always on top. Its datasource should be YourTable
.
Call the new form from the lookup method (or better, from a method at the table level called from the lookup method) using ClassFactory.formRunClass(args)
.
I found a 'simple' solution: i've to simply override the method modifieldfield