Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect value of selected value when inserting a new item #1422

Open
caldera500 opened this issue Jan 28, 2023 · 0 comments
Open

Detect value of selected value when inserting a new item #1422

caldera500 opened this issue Jan 28, 2023 · 0 comments

Comments

@caldera500
Copy link

caldera500 commented Jan 28, 2023

Is there a way to detect when the value of a dropdown gets changed when inserting a new item. I want to disable some of the other inputs depending on the value that is detected.

{insertTemplate: function(value, item){
  if(item.value == 'A'){
   $("#grid").jsGrid("fieldOption", "Size", "inserting", false);
},
 name: 'category', title: 'Category', type: 'select', 
      items:['', A ', 'B', 'C, 'D']},

I can detect the value of the dropdown like this:

$(document).on('change','#grid .jsgrid-insert-row select',function(){
  console.log("change detected", this.value);
});

However setting the field option after the grid is created is not possible using
$("#grid").jsGrid("fieldOption", "Size", "inserting", false);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant