Good time of the day, Tony!
A small change in the code above. Call addClass functions should be done before the call formatter.
In this case, formatting can be managed through the classes too. For example, turn it off in class ‘unformat ‘:)
@@ -659,16 +659,17 @@
grid.cols[k] = this;
});
};
– var addCell = function(t,row,cell,pos) {
+ var addCell = function(t,row,cell,pos,cssp) {
var td;
td = document.createElement(“td”);
– formatter($(td,t),row,cell,pos,’add’);
+ if (cssp) { $(td,t).addClass(cssp); }
+ formatter($(td,t),row,cell,pos,’add’);
row.appendChild(td);
formatCol($(td,t), pos);
};
var formatter = function (elem, row, cellval , colpos, act){
var cm = ts.p.colModel[colpos];
– if(cm.formatter) {
+ if ( (cm.formatter) && (!$(elem).hasClass(‘unformat’)) ) {
var opts= {rowId: row.id, colModel:cm,rowData:row};
if($.isFunction( cm.formatter ) ) {
cm.formatter(elem,cellval,opts,act);
With best wishes,
Serg.