As shown in ext.net examples, this is code to format a column-entry
var template = '<span style="color:{0};">{1}</span>';
var change = function (value) {
return String.format(template, (value > 0) ? "green" : "red", value);
};
now my question is, i want to format column company likewise.
var company = function(value) {
return String.format(template, (record.data.change > 0) ? "green" : "red", value);
};
this did not work as record will not be given to the function, also i failed to pass a parameter to Fn called on renderer
var company = function(value, change) {
return String.format(template, (change > 0) ? "green" : "red", value);
};
i could also imagine a workaround with jquery, but that’s just a whole bunch of work and selectors. and as i am quite new to ext.net / extjs i am sure i overlooked something
P.S. yes i am using the older version of ext.net, thus the link is to examples1.ext.net 😉
You should always take a look at the ExtJS API. Here you would looking for Ext.grid.column.Column-cfg-renderer
The renderer arguments are
The data value for the current cell
A collection of metadata about the current cell; can be used or modified by the renderer. Recognized properties are: tdCls, tdAttr, and style.
The record for the current row
The index of the current row
The index of the current column
The data store
The current view
so I guess this should work for you