i want add increase and decrease method to button + and - for the centered number and i want the number keep editable
my code:
function eXcell_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;
eXcell_ed.call(this); //uses methods of the “ed” type
}
this.setValue=function(val){
this.setCValue(“<input type=‘button’ value=‘+’>”+val+“<input type=‘button’ value=‘-’>”);
}
this.getValue=function(){
return this.cell.firstChild.value; // get button label
}
}
eXcell_button.prototype = new eXcell;
Hi All,
I’m close to the goal , but i don’t increase or decrease on event,
i need help
my new code :
function eXcell_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;
// eXcell_ed.call(this); //uses methods of the “ed” type
}
this.edit=function(){
this.val = this.getValue(); // save current value
this.val = this.cell.childNodes[1].value;
this.cell.childNodes[1].value=parseInt(this.val); // set the first part of data
}