This is a migrated thread and some comments may be shown as answers.

Extending click event for Command button

1 Answer 222 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 02 Dec 2015, 08:01 PM

Hi All,

 

I used  getOptions and setOptions in our project with no issue, except for one.  I re-applied the click event back to the command button after using grid.setOption with the following script

 var sourceClickEvent = columnClickEvent;   //columnClickEvent calls myfunction ()
 $.extend(myTarget.dataSource.options.fields[j].command[k], { click: sourceClickEvent });

 and I can see the click event for the command button, but every time I click on the button the click event does not fired.  Could anyone tell me what I did wrong?

 TIA

 

 

1 Answer, 1 is accepted

Sort by
0
Steve
Top achievements
Rank 1
answered on 03 Dec 2015, 09:24 PM

Figured it out.  Just need to apply the .off('click') before the .on('click')

$("#grid").off('click').on('click', '.k-grid-yes, .k-grid-no', function (e) {

});

Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Answers by
Steve
Top achievements
Rank 1
Share this question
or