dojo.provide("earray.grid.cells"); dojo.require("dojox.grid.cells"); (function(){ dojo.declare("earray.grid.cells.RowSelectorCell", dojox.grid.cells.AlwaysEdit, { // returnIndex: Integer // editor returns only the index of the selected option and not the value editable : true, alwaysEditing: true, objectId : "", _valueProp: "checked", format: function(inRowIndex, inItem){ // summary: // provides the html for a given grid cell. // inRowIndex: int // grid row index // returns: html for a given grid cell if (!inItem) return; var f, i=this.grid.edit.info, d=this.get ? this.get(inRowIndex, inItem) : (this.value || this.defaultValue); if(this.editable && (this.alwaysEditing || (i.rowIndex==inRowIndex && i.cell==this))){ var thisnode = inItem.cells[this.index]; this.objectId = dojo.attr(thisnode,"value"); return this.formatEditing(d, inRowIndex); }else{ var v = (d != this.defaultValue && (f = this.formatter)) ? f.call(this, d, inRowIndex) : d; return (typeof v == "undefined" ? this.defaultValue : v); } }, formatEditing: function(inDatum, inRowIndex){ if (inDatum == "readonly") return " " else { var funcName = inDatum == "true" ? "addToSelection" : "deselect"; this.grid.selection[funcName](inRowIndex); //this.objectId = dojo.attr(this.domNode,"value"); return '
'; } }/*, doclick: function(e){ if(e.target.tagName == 'INPUT'){ var t = e.target; var funcName = t.checked ? "addToSelection" : "deselect"; this.grid.selection[funcName](e.rowIndex); } }*/ }); earray.grid.cells.RowSelectorCell.markupFactory = function(node, cell){ dojox.grid.cells.AlwaysEdit.markupFactory(node, cell); } dojo.declare("earray.grid.cells.LinkCell", dojox.grid.cells.AlwaysEdit, { // returnIndex: Integer // editor returns only the index of the selected option and not the value editable : true, alwaysEditing: true, htmlText : "", format: function(inRowIndex, inItem){ // summary: // provides the html for a given grid cell. // inRowIndex: int // grid row index // returns: html for a given grid cell if (!inItem) return; var f, i=this.grid.edit.info, d=this.get ? this.get(inRowIndex, inItem) : (this.value || this.defaultValue); if(this.editable && (this.alwaysEditing || (i.rowIndex==inRowIndex && i.cell==this))){ var thisnode = inItem.cells[this.index]; this.htmlText = thisnode.innerHTML; return this.formatEditing(d, inRowIndex); }else{ var v = (d != this.defaultValue && (f = this.formatter)) ? f.call(this, d, inRowIndex) : d; return (typeof v == "undefined" ? this.defaultValue : v); } }, formatEditing: function(inDatum, inRowIndex){ return this.htmlText; }, doclick: function(e){ if(e.target.tagName != 'TD' ){ var t = e.target; } } }); earray.grid.cells.LinkCell.markupFactory = function(node, cell){ dojox.grid.cells.AlwaysEdit.markupFactory(node, cell); } dojo.declare("earray.grid.cells.ActionCell", dojox.grid.cells.AlwaysEdit, { // returnIndex: Integer // editor returns only the index of the selected option and not the value editable : true, alwaysEditing: true, htmlText : "", format: function(inRowIndex, inItem){ // summary: // provides the html for a given grid cell. // inRowIndex: int // grid row index // returns: html for a given grid cell if (!inItem) return; var f, i=this.grid.edit.info, d=this.get ? this.get(inRowIndex, inItem) : (this.value || this.defaultValue); if(this.editable && (this.alwaysEditing || (i.rowIndex==inRowIndex && i.cell==this))){ var thisnode = inItem.cells[this.index]; this.htmlText = thisnode.innerHTML; return this.formatEditing(d, inRowIndex); }else{ var v = (d != this.defaultValue && (f = this.formatter)) ? f.call(this, d, inRowIndex) : d; return (typeof v == "undefined" ? this.defaultValue : v); } }, formatEditing: function(inDatum, inRowIndex){ return this.htmlText; }, doclick: function(e){ if(e.target.tagName != 'TD' ){ var t = e.target; } } }); earray.grid.cells.ActionCell.markupFactory = function(node, cell){ dojox.grid.cells.AlwaysEdit.markupFactory(node, cell); } dojo.declare("earray.grid.cells.LabelCell", dojox.grid.cells.AlwaysEdit, { // returnIndex: Integer // editor returns only the index of the selected option and not the value editable : true, alwaysEditing: true, htmlText : "", format: function(inRowIndex, inItem){ // summary: // provides the html for a given grid cell. // inRowIndex: int // grid row index // returns: html for a given grid cell if (!inItem) return; var f, i=this.grid.edit.info, d=this.get ? this.get(inRowIndex, inItem) : (this.value || this.defaultValue); if(this.editable && (this.alwaysEditing || (i.rowIndex==inRowIndex && i.cell==this))){ var thisnode = inItem.cells[this.index]; this.htmlText = thisnode.innerHTML; return this.formatEditing(d, inRowIndex); }else{ var v = (d != this.defaultValue && (f = this.formatter)) ? f.call(this, d, inRowIndex) : d; return (typeof v == "undefined" ? this.defaultValue : v); } }, formatEditing: function(inDatum, inRowIndex){ return this.htmlText; }, doclick: function(e){ if(e.target.tagName != 'TD' ){ var t = e.target; } } }); earray.grid.cells.LabelCell.markupFactory = function(node, cell){ dojox.grid.cells.AlwaysEdit.markupFactory(node, cell); } dojo.declare("earray.grid.cells.TextBoxCell", dojox.grid.cells.AlwaysEdit, { // returnIndex: Integer // editor returns only the index of the selected option and not the value editable : true, alwaysEditing: true, htmlText : "", format: function(inRowIndex, inItem){ // summary: // provides the html for a given grid cell. // inRowIndex: int // grid row index // returns: html for a given grid cell if (!inItem) return; var f, i=this.grid.edit.info, d=this.get ? this.get(inRowIndex, inItem) : (this.value || this.defaultValue); if(this.editable && (this.alwaysEditing || (i.rowIndex==inRowIndex && i.cell==this))){ var thisnode = inItem.cells[this.index]; this.htmlText = thisnode.innerHTML; return this.formatEditing(d, inRowIndex); }else{ var v = (d != this.defaultValue && (f = this.formatter)) ? f.call(this, d, inRowIndex) : d; return (typeof v == "undefined" ? this.defaultValue : v); } }, formatEditing: function(inDatum, inRowIndex){ return this.htmlText; }, doclick: function(e){ if(e.target.tagName != 'TD' ){ var t = e.target; } } }); earray.grid.cells.TextBoxCell.markupFactory = function(node, cell){ dojox.grid.cells.AlwaysEdit.markupFactory(node, cell); } })();