Skip to content Skip to sidebar Skip to footer

Creating A Checkbox In Javascript And Dhtmlx

I am trying to create a javascript based checkbox and the but somehow I am not able to make it work. I created a question earlier but somehow not able to add my code to the comment

Solution 1:

You need to create all your html content that needed to be displayed in your cell in the setValue function. Here is the simplified example:

function eXcell_includeDC(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
    // the cell is read-only, so it's always in the disabled state
    this.isDisabled = function(){ return true; }
    this.setValue=function(val){
        if (val=="Y")
        this.setCValue("<input type='checkbox' checked='checked/>",val);
        else
        this.setCValue("<input type='checkbox'/>",val);
    }
}
eXcell_includeDC.prototype = new eXcell;

Post a Comment for "Creating A Checkbox In Javascript And Dhtmlx"