Hi,
I have a grid with some cells in col index 3 set to combo type, therefore I can select an item from the combolist when the cell in edit mode, the combo is selectable only (readonly) but not allow text input, however I want the user can clear the selection if they press backspace or del when the combo is in edit mode. I attached a event but it seems the event was not fired.
Am I doing something wrong? Please advise, thank you!
// SIM Card Grid Init
strContrLoad = “GridViewConnector.ashx?strSQL=SELECT bababababa…”;
grdSIMCard.clearAndLoad(strContrLoad, function () {
for (i = 0; i < grdSIMCard.getRowsNum(); i++) {
rId = grdSIMCard.getRowId(i);
if (grdSIMCard.cells(rId, 1).getValue() == "SIM OWNER") {
[b]grdSIMCard.setCellExcellType(rId, 3, "combo"); // Amend Value[/b]
strContrLoad = "ComboConnector.ashx?strSQL=SELECT CONTENT_DESC FROM LST_FIELD_OPTIONS WHERE TABLE_NAME = 'ORDER_ACCESSORY' AND FIELD_NAME = 'SIM_OWNER' AND IS_FIELD_HEADER = 0 &strValueColumn=CONTENT_DESC &strNameColumn=CONTENT_VALUE";
grdSIMCard.cells(rId, 3).getCellCombo().loadXML(strContrLoad);
grdSIMCard.cells(rId, 3).getCellCombo().enableOptionAutoHeight(true);
grdSIMCard.cells(rId, 3).getCellCombo().readonly(true, true);
} else if (grdSIMCard.cells(rId, 1).getValue() == "SIM SPROVIDER") {
[b]grdSIMCard.setCellExcellType(rId, 3, "combo"); // Amend Value[/b]
strContrLoad = "ComboConnector.ashx?strSQL=SELECT SERVICE_PROVIDER_NAME FROM LST_SERVICE_PROVIDER WHERE ACTIVE = 1 &strValueColumn=SERVICE_PROVIDER_NAME &strNameColumn=SERVICE_PROVIDER_NAME";
grdSIMCard.cells(rId, 3).getCellCombo().loadXML(strContrLoad);
grdSIMCard.cells(rId, 3).getCellCombo().enableOptionAutoHeight(true, 200);
grdSIMCard.cells(rId, 3).getCellCombo().readonly(true, true);
}
}
});
// SIM Card EVENT
grdSIMCard.attachEvent(“onRowAdded”, grdSIMCard_onRowAdded);
grdSIMCard.attachEvent(“onEditCell”, grdSIMCard_onEditCell);
[b]grdSIMCard.getColumnCombo(3).attachEvent("onKeyPressed", function (keyCode) {
if (keyCode == 46 || keyCode == 8) { //Del,Backspace
dhtmlx.message(keycode); //for debug
this.setComboValue("");
this.unSelectOption();
}[/b]
});