Hi Team.
We’re using:
Product Name: dhtmlxSuite
Version: 4.1.2
Edition: Professional
Problem: Can’t preselect combobox item using any of api methods: setComboValue() or selectOption().
Sample Code:
// DHTMLXGrid with columns types as this “ro,ch,combo,combo,combo,combo,combo,combo,combo,combo,combo”
// After grid is created
// Data into grid loaded via API methods
var newRowId = 'test01';
var colIndex = 2;
var rowValues = new Array();
rowValues[rowValues.length] = 'Test Row';
rowValues[rowValues.length] = 1;
// Add a new row into grid
gs_grid.addRow(newRowId, rowValues);
var combo = gs_grid.cells(newRowId, colIndex).getCellCombo();
combo.addOption('0', '');
combo.addOption('1', 'One');
combo.addOption('2', 'Two');
var optionIndex = combo.getIndexByValue('1');
console.info('optionIndex:'+optionIndex); // this returns "optionIndex:1"
//Neither of the below two methods selects option "One"
combo.selectOption(optionIndex, false, true); // By index
combo.setComboValue('1'); // By value
If I now double click cell - I have correct list of values - but I can't make it to pre-select required value.
Please help.
It’s very importent for us to proceeed.
Thanks in advance.