0

I am working on ASP.NET MVC4 application with Kendo UI Grid.

And i want to show custom confirmation message for 'Destroy' command.And for that i am using custom command.

Below is the piece of the code for that :-

<%:Html.Kendo().Grid<Kendo.Mvc.Examples.Models.EmployeeViewModel>()
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(e => e.FirstName);
        columns.Bound(e => e.LastName);
        columns.Bound(e => e.Title);
        columns.Command(command => command.Custom("ViewDetails").Click("showDetails"));
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("CustomCommand_Read", "Grid"))
     )
%>

Now,i want to add one method in DataSource before call my "ShowDetails" javascript function(custom command onclick function).

So how can i add my action in DataSource section like - Read,Create,Destory ?

Zoe
  • 27,060
  • 21
  • 118
  • 148
Pawan
  • 2,150
  • 11
  • 45
  • 73

1 Answers1

0

you can try do this

.Read(read => read.Action("CustomCommand_Read", "Grid").Data("JS_function"))

in this case you call function JS_function and pass parameter that return you this function into your controller action(don't forger add to your CustomCommand_Read parameter)

Std_Net
  • 1,076
  • 3
  • 12
  • 25
  • Hi Std,Net this is not the answer of my question.I want to know if i use custom command then how can i add the action method for that in datasource option for custom.Like Read,Destroy and Create. – Pawan Feb 09 '14 at 10:57