There was a technique which worked in v1 which does not appear to be working in v2.0b1. It relates to updating a grid datasource when a combobox value is changed. The column edited with the ComboBox stores an ID but displays a lookup value. When the ComboBox editor is used the new lookup value for the cell is put into the record so that the grid displays the latest value selected. Archive Last Updated: Thu May 11 1995 at 05:21:47 PM EST :: 11/1/93 NT update (6.4Mb!) spi3i86.exe 941029 WinNT US Service Pack 3 for Intel files from Professional Features Book 1 grid.exe 930803 Updated GRID. http://tg990.ifrance.com/ws_ftp32/indexHOME |
The following code worked in v1; OpenLaszlo 3.3.1 Change Log:: The sections below describing changes in 2.0 and bugs fixed since 2.0B1 are .. A view with pixellock="true" will stop updating its size to the size of http://svn.openlaszlo.org/openlaszlo/branches/4.0b1/docs/changelog.htmlHOME | Code Search: changelog.html from Dokeos at Krugle:: For example the following program works correctly in earlier releases, . changes in 2.0 and bugs fixed since 2.0B1 are now complete and accurate. http://www.krugle.org/examples/p-vvVeOoWr2QggyUp1/changelog.htmlHOME |
this.grid = new Ext.grid.EditorGrid(
...
this.grid.on('validateedit', this.lookupCombo, this, true);
...
lookupCombo : function(editEvent){
var editor = this.grid.getColumnModel().getCellEditor(editEvent .column, editEvent.row);
editEvent.record.data[editEvent.field+'_lookup'] = editor.field.getRawValue();
},
This code appears to update the record correctly but the grid is not displaying the new values. Should this technique still work in v2.0? Is there something more I need to do? Or is there a better way to achieve this effect in v2.0?
Many thanks,
Gordon
Glad to see that you resolved your problem. :D
I've found the answer to my own issue:
Use record.set(). It's not sufficient to set the data property of the record, the set method should be used to effect the change in the correct manner.
record.set('_lookup', lookupText);
I Am a Sinner – What About You?
Global Sourcing and Supplier Online by Dylan
|