Follow below steps to apply Conditional Row expander - only to remove/hide (+) icon. with out disturbing default behaviour of row expander
Step1:
Declare this css in your JSP
/* style classs to hide Row expander icon (+) - conditional */
.hide-row-expander .x-grid-row-expander {
visibility: hidden;
}
Step2:
// Declare row expander plug-in in your Grid panel
plugins: [{
ptype: 'rowexpander', // TODO - uncomment this plugin - to have default behaviour of row expander
selectRowOnExpand : true, // true to select a row when clicking on the expander icon
expandOnDblClick: false, // true to toggle a row between expanded/collapsed when double clicked
expandOnEnter : false,
rowBodyTpl: new Ext.XTemplate()
}]
Step3:
Apply style class in grid panel
viewConfig: {
stripeRows: true,
// This renderer to apply conditional css on each grid row based specific column value (dtcc status)
getRowClass: function (record, rowIndex, rowParams, store) {
var str = record.get('name');
if(str == ' '){ // if name column is blank
return 'hide-row-expander';
}
}
}//end of viewconfig
Step1:
Declare this css in your JSP
/* style classs to hide Row expander icon (+) - conditional */
.hide-row-expander .x-grid-row-expander {
visibility: hidden;
}
Step2:
// Declare row expander plug-in in your Grid panel
plugins: [{
ptype: 'rowexpander', // TODO - uncomment this plugin - to have default behaviour of row expander
selectRowOnExpand : true, // true to select a row when clicking on the expander icon
expandOnDblClick: false, // true to toggle a row between expanded/collapsed when double clicked
expandOnEnter : false,
rowBodyTpl: new Ext.XTemplate()
}]
Step3:
Apply style class in grid panel
viewConfig: {
stripeRows: true,
// This renderer to apply conditional css on each grid row based specific column value (dtcc status)
getRowClass: function (record, rowIndex, rowParams, store) {
var str = record.get('name');
if(str == ' '){ // if name column is blank
return 'hide-row-expander';
}
}
}//end of viewconfig
Comments
Post a Comment