Syed Huda
13 Dec 2010, 3:53 PM
Hello,
I'm trying to follow this example where the array grid item uses renderer to make it red or green based on the item value:
http://dev.sencha.com/deploy/dev/examples/grid/array-grid.html
This is the function that makes the change:
function change(val) {
if (val > 0) {
return '<span style="color:green;">' + val + '</span>';
} else if (val < 0) {
return '<span style="color:red;">' + val + '</span>';
}
return val; }
And the rendere is used here in the column model:
{
header : 'Change',
width : 75,
sortable : true,
renderer : change,
dataIndex: 'change'}
Is there a way to pass another item for "val"? For example I have a column 'Change 2', and depending on the value of that column I want to use a renderer to make 'Change' column red.
Hope this makes sense.
I'm trying to follow this example where the array grid item uses renderer to make it red or green based on the item value:
http://dev.sencha.com/deploy/dev/examples/grid/array-grid.html
This is the function that makes the change:
function change(val) {
if (val > 0) {
return '<span style="color:green;">' + val + '</span>';
} else if (val < 0) {
return '<span style="color:red;">' + val + '</span>';
}
return val; }
And the rendere is used here in the column model:
{
header : 'Change',
width : 75,
sortable : true,
renderer : change,
dataIndex: 'change'}
Is there a way to pass another item for "val"? For example I have a column 'Change 2', and depending on the value of that column I want to use a renderer to make 'Change' column red.
Hope this makes sense.