source: [view]
var self = this;
var getCellWidth = function(inDef){
var w = 0;
if(inDef.colSpan > 1){
w = 0;
}else{
w = inDef.width || self._defaultCellProps.width || self.defaultWidth;
if(!isNaN(w)){
w = w + "em";
}
}
return w;
};
var props = {
grid: this.grid,
subrow: inRowIndex,
layoutIndex: inCellIndex,
index: this.cells.length
};
if(inDef && inDef instanceof dojox.grid.cells._Base){
var new_cell = dojo.clone(inDef);
props.unitWidth = getCellWidth(new_cell._props);
new_cell = dojo.mixin(new_cell, this._defaultCellProps, inDef._props, props);
return new_cell;
}
var cell_type = inDef.type || inDef.cellType || this._defaultCellProps.type || this._defaultCellProps.cellType || dojox.grid.cells.Cell;
props.unitWidth = getCellWidth(inDef);
return new cell_type(dojo.mixin({}, this._defaultCellProps, inDef, props));