ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: bsolteam on December 03, 2014, 08:52:54 pm

Title: Dynamic Editor options
Post by: bsolteam on December 03, 2014, 08:52:54 pm
Hi,

I want to give editor options dynamically. Here I attached the Image. In that toolbar, select option is there. Based on the selection I need to change the editor options. Based on the rule name I need to give different  editor options for Rule val column. Please help me to do this.

Thanks in advance.
Title: Re: Dynamic Editor options
Post by: paramvir on December 04, 2014, 10:33:30 am
it's mentioned in the docs:

http://paramquery.com/pro/api#option-column-editor

Get or set the column > editor option, after initialization:

var colM=$( ".selector" ).pqGrid( "option", "colModel" );

//setter
//set custom editor for 2nd column
colM[1].editor = {
    type: function(ui){                   
    },
    getData: function(ui) {
    }
};
$( ".selector" ).pqGrid( "option", "colModel", colM );
Title: Re: Dynamic Editor options
Post by: bsolteam on December 16, 2014, 11:57:01 am
Hi Team,

In My project lot of tabs are there. Whenever changing of rule name I want to give different editor options. For few rule name I want to give drop down select options in rule value column. For drop down select I need to take the value from other tab cell values. At the same time if they are changing in other tab cell values it should reflect the drop down options. In your previous reply i got some codes but I can't able to use properly. Please provide some sample codes to use that functionality.

Also Thanks for your wonderful support.   
Title: Re: Dynamic Editor options
Post by: paramvir on December 19, 2014, 10:50:24 am
As I understand you want to change select options dynamically, which could simply be done as

colM[ i ].editor.options = new_options;

$( ".selector" ).pqGrid( "option", "colModel", colM );