View Full Version : How to add additional parameters to the renderer function
tookoo
1 Feb 2007, 2:32 PM
When I define the column model in the grid, is it possible to add additional parameters to the renderer function? Thanks.
tryanDLS
1 Feb 2007, 2:47 PM
This should be possible via createDelegate. Start with this thread from earlier today
http://www.yui-ext.com/forum/viewtopic.php?t=2465
casz69
19 Mar 2008, 7:11 PM
I think this could be a solution:
LogicalIntRender = function(params) {
return function (value, metadata, record, rowIndex, colIndex, store) {
if ( value == 'null' || value == null ) {
return '';
}
if ( value == 0 ) {
metadata.css= params.noCss ? params.noCss : 'LogicalIntRenderFalse';
return "No";
}
if ( value == 1 ) {
metadata.css=params.yesCss ? params.yesCss : 'LogicalIntRenderTrue';
return "Yes";
}
};
}
And in column renderer:
renderer: LogicalIntRender({ noCss: 'LogicalIntRenderFalse', yesCss: 'LogicalIntRenderTfrue'})
I hope this help you.
bobbher
3 Jul 2009, 4:38 PM
Awesome!! that works for me!! thanks!!
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.