ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: Balaji on November 29, 2016, 03:49:29 pm

Title: detail Model turning on / off at run time
Post by: Balaji on November 29, 2016, 03:49:29 pm
Hi,

I need to turn on or off detail model of the grid dynamically at run time. Is there any way to do this.

Thank you.
Title: Re: detail Model turning on / off at run time
Post by: paramvir on November 29, 2016, 09:52:21 pm
It can be done by toggling detailModel.init callback.

Code: [Select]
toolbar: {
items: [
{
type:'button',
label: 'Remove detailModel',
listener: function(){
this.option('detailModel.init', null);
var ci = this.getColIndx({dataIndx:'pq_detail'});
if(ci >= 0){
var CM = this.option('colModel');
CM.splice(ci, 1);
this.option('colModel', CM );
}
this.refreshView();
}
}
]
},