Author Topic: Dynamic Editor options  (Read 3417 times)

bsolteam

  • Pro Deluxe
  • Full Member
  • *
  • Posts: 107
    • View Profile
Dynamic Editor options
« 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.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Dynamic Editor options
« Reply #1 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 );

bsolteam

  • Pro Deluxe
  • Full Member
  • *
  • Posts: 107
    • View Profile
Re: Dynamic Editor options
« Reply #2 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.   

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Dynamic Editor options
« Reply #3 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 );