Reputation: 2049
My grid is
@(Html.kendo().Grid<StudentViewModel>()
.Columns( x=>
{
x.Bound( y => y.StudentId);
x.Bound(y => y.SubjectId);
x.Bound(y => y.Name);
})
here when user clicks on "StudentId" or "SubjectId" cell in those columns want to show a popup, how to get the cell click event and verify that is the right column. How to get the cell click event ?
Upvotes: 2
Views: 13132
Reputation: 73
To add onto the previous answers: In your grid, add an event binding
@(Html.kendo().Grid<StudentViewModel>()
.Columns(...)
.Events(events => events.Change("onChange"))
})
Then, in your javascript section, add a function like Arturo suggested:
function onChange(arg) {
var selected = $.map(this.select(), function (item) {
return $(item).text();
});
}
This example from Telerik might help: http://demos.telerik.com/aspnet-mvc/grid/events
Upvotes: 2
Reputation: 49
you can check the event documentation here: http://docs.telerik.com/kendo-ui/getting-started/framework/mvvm/bindings/events
Upvotes: 0
Reputation: 49
You can do something like:
function onChange(arg) {
var selected = $.map(this.select(), function(item) {
return $(item).text();
});
And add anything inside you want to be executed.
Upvotes: 0