PDA

View Full Version : Display RowExpander on condition only



loginfabio
1 Mar 2013, 7:35 AM
Hello,

in ExtJs3 you can put a condition on showing rowexpander, something like:



var grRowExp = new Ext.grid.RowExpander({
renderer: function(v,p,record){
p.cellAttr='rowspan="2"';
with(record.data){
if(prn_testelem!='' || prn_testdescr!='' || prn_testnote!='')
return '<div class="x-grid3-row-expander"> </div>';
else
return ' ';
}
},
tpl:new Ext.XTemplate(
'<tpl for=".">',
......................
'</tpl>'
)
});


In ExtJs4, is there a way to do the same thing?
I've tried changing renderer, but it doesn't work!!!.



//Grid
plugins : [
{pluginId: 'pro-scp3-expander', ptype: 'rowexpander',
rowBodyTpl : [
'<div class="pr-v1">....</div>',
............
'<div class="pr-vN">....</div>',
],
renderer: function(value, metadata, record, rowIdx, colIdx){
console.log(value) ;
console.log(metadata) ;
console.log(record) ;
console.log(rowIdx) ;
console.log(colIdx) ;
}
}
]
....


Thanks in advance!!!

mitchellsimoens
4 Mar 2013, 8:22 AM
I do not believe this is possible.