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

Tutorial using change event args

1 Answer 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
flipdoubt
Top achievements
Rank 1
flipdoubt asked on 20 Nov 2012, 07:34 PM
I used Telerik Components for ASP.NET MVC and recently upgraded to Kendo UI. I must admit it has been a very rough transition due to incomplete documentation and demos that are not nearly as good as those for Telerik Components for ASP.NET MVC. For example, the Grid events documentation does not show how to do anything with the "e" arg passed into the handler.

I am struggling to use the event args or even the "this" passed into my change event handler. I cannot even tell which cell was clicked or whether the actual clicked element was an anchor tag that should show a popup. When I run the code "e.cellIndex()" returns -1. What good is that?

Can someone point me to a tutorial that helped them use the change event? Thanks.

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 23 Nov 2012, 10:45 AM
Hello David,

When using the Row selection feature - you have access to the row/rows which are currently selected.
You can get a reference like this:

$('#gridWithRowSelection').data().kendoGrid.bind('change',function(e){
    var rows = this.select();
})

If you are using cell selection you will retrieve the td element(s) which are selected. Again with the same approach:

$('#gridWithCellSelection').data().kendoGrid.bind('change',function(e){
    var cells= this.select();
})


Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
flipdoubt
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or