I am trying to create a custom column type for use in a treegrid column. The custom type should be an input button. I am using the following code:
function eXcell_action_button(cell) { //the eXcell name is defined here
if (cell) { // the default pattern, just copy it
this.cell = cell;
this.grid = this.cell.parentNode.grid;
}
this.edit = function() {} //read-only cell doesn't have edit method
this.isDisabled = function() {return true;} // the cell is read-only, so it's always in the disabled state
this.setValue = function(val) {
console.log('eXcell_action_button(): Value = ', val);
this.setCValue("<input type='button' value='"+val+"'>",val);
}
this.getValue = function(val) {
return this.cell;
}
}
eXcell_action_button.prototype = new eXcell;// nests all other methods from the base class
var appLayout = new dhtmlXLayoutObject({
parent: document.body,
pattern: "2U",
});
ec2Grid = appLayout.cells('a').attachGrid();
ec2Grid.setColTypes("tree,action_button,coro,rotxt");
ec2Grid.init();
I have been researching and trying to get this to work for two days now. Any hlep would be greatly appreciated.
Thanks,
Daryl