var dgrid = new dhtmlXGridObject(‘devGrid’);
dgrid.setImagePath("…/codebase/imgs/");
dgrid.setHeader(“Name, Value”);
dgrid.setInitWidths("*, 100");
dgrid.setColAlign(“left, center”);
dgrid.setSkin(“light”);
dgrid.setColSorting(“na,na”);
dgrid.setColTypes(“ro,ro”);
dgrid.enableDragAndDrop(true);
dgrid.init();
dgrid.loadXMLString(“NameDirect Processor 1”+
“not setproc 1”);
dgrid.attachEvent(“onXLE”,function(){
var combo = dgrid.cells(‘direct_processor_1’,1).getCellCombo();
combo.readonly(true);
combo.selectOption(1); // index
//combo.setComboValue(“not_set”); //value
});
Hello,
the value should be set in grid. So, the xml string can be:
dgrid.loadXMLString(“NameDirect Processor 1”+
“not_setnot setproc 1”);
The event handler can be deleted:
//dgrid.attachEvent(“onXLE”,function(){…})
This way the option appears as selected, but combo.getSelectedValue() returns null and combo.getSelectedIndex() returns -1, so evidently combo box is not really ‘selectiong’ that option.
Let me ask the question differently, - is there a way to programmatically select an option in combo box used as a cell editor? Documentation specifies 2 methods below, but none of them have any effect on my combo! Please, help.
combo.selectOption(0); // index
combo.setComboValue(“not_set”); //value
In case of combo excell only grid methods can be use to set and get cell (combo) value:
grid.cells(rowId,cellIndex).setValue(value);
var value = grid.cells(rowId,cellIndex).getValue();
Thank you! That works!!