Jan 17, 2011, 11:03 PM
Syntax for GridPanel Renderer Function in Codebehind breaks in older browsers
Hello,
The following javascript code is an example of the syntax required to perform custom rendering:
Gridpanel1.ColumnModel.Columns(x).Renderer.Fn = "pctChange"
Chrome 8.0.552 & Firefox 3.6.13 seem to be fine also. It appears that the "var =..." syntax is not liked. Is there an alternative way of setting Renderer.Fn to a javascript function in codebehind?
Thanks
The following javascript code is an example of the syntax required to perform custom rendering:
var pctChange = function (value) {
return String.format(template, (value < 0) ? "red" : "green", value.toFixed(0) + "%");
};
It works well in modern/wellbehaved browsers :). However, if using IE7 (or turn compatibility view on in IE8) and use the follwing syntax in codebehind to set the formatting in a gridpanel Gridpanel1.ColumnModel.Columns(x).Renderer.Fn = "pctChange"
Chrome 8.0.552 & Firefox 3.6.13 seem to be fine also. It appears that the "var =..." syntax is not liked. Is there an alternative way of setting Renderer.Fn to a javascript function in codebehind?
Thanks