Hi
I have customized the “ch” column type in the following way:
[code]function eXcell_jdaEdBool(cell) {
if (cell) {
this.cell = cell;
this.grid = this.cell.parentNode.grid;
this.setBgColor(jdaEdCellTypesBgColor);
this.setHorAlign(‘center’);
}
// Indicates whether editing is allowed.
this.isDisabled = function() {
return false;
};
//Get the value for export cell data
this.getContent = function() {
var a=this.cell.firstChild;
var val = (a && a.tagName) ? a.checked : "";
return (val == 'true' || val == 1 || val == 'on') ? "1" : "0";
};
this.changeState = function (a) {
a === !0 && !this.grid.isActive && (window.globalActiveDHTMLGridObject != null && window.globalActiveDHTMLGridObject != this.grid && window.globalActiveDHTMLGridObject.isActive &&
window.globalActiveDHTMLGridObject.setActive(!1), this.grid.setActive(!0));
if (this.grid.isEditable && !this.cell.parentNode._locked && !this.isDisabled())
this.grid.callEvent("onEditCell", [0, this.cell.parentNode.idd, this.cell._cellIndex]) ?
(this.val = this.getValue(),
this.val ? this.setValue("1") : this.setValue("0"),
this.cell.wasChanged = !0,
this.grid.callEvent("onEditCell", [1, this.cell.parentNode.idd, this.cell._cellIndex]),
this.grid.callEvent("onCheckbox", [this.cell.parentNode.idd, this.cell._cellIndex,
this.val != "1"]),
this.grid.callEvent("onCheck", [this.cell.parentNode.idd, this.cell._cellIndex, this.val != "1"])) :
this.editor = null ;
};
this.getValue = function () {
return this.cell.firstChild.checked;
};
this.isCheckbox = function () {
return !0
};
this.isChecked = function () {
return this.getValue() == "1" ? !0 : !1
};
this.setChecked = function (a) {
this.setValue(a.toString())
};
this.detach = function () {
return this.val != this.getValue()
};
this.setValue = function(val){
var newVal = '<input onclick=\'new eXcell_jdaEdBool(this.parentNode).changeState(true);\' type="checkbox"' +
((val.replace(/(\r\n|\n|\r)/g, "").toLowerCase() == 'true' || val == 1) ? ' checked' : '') + (this.isDisabled() ? ' disabled' : '') + '/>';
this.setCValue(newVal, val);
}
this.edit = null;
}
eXcell_jdaEdBool.prototype = new eXcell;[/code]
Now I have written an event on cell edit:
myGrid.attachEvent("onEditCell", onCellEdit);
function onCellEdit(stage,rId,cInd,nValue,oValue){
console.log("stage..." + stage+" new value.." + nValue + " old value..." + oValue);
return true;
I get undefined in the new value as well as old value in both stage 0 and stage 1.
Could you please help me figure out what am I doing wrong here?