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

Grid command edit and destroy don't run action

0 Answers 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dechochai
Top achievements
Rank 1
Dechochai asked on 19 Sep 2012, 07:20 AM
my command don't run 
.Create(c=>c.Action("CreateNewEmployee", "HRM")) 
.Update(update => update.Action("Employee_Update", "HRM"))
        .Destroy(update => update.Action("Employee_Destroy", "HRM")) 
in controller but can run
.Read(read => read.Action("Employee_Read", "HRM")) 

@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.EmpID).Visible(false);
        columns.Bound(p => p.Role);
        columns.Bound(p => p.Branch);
        columns.Bound(p => p.Name);
        columns.Bound(p => p.Address);
        columns.Bound(p => p.Username);
        columns.Bound(p => p.Status);
        columns.Command(c =>
        {
            c.Edit();
            c.Destroy();
        }).Width(250);
    })
    .Editable(editable =>
    {
        editable.Mode(GridEditMode.PopUp);
        editable.TemplateName("EmployeeEditor");
    })
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .ToolBar(toolbar =>
    {
        toolbar.Create();
        })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(10)
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.EmpID))
        .Create(c=>c.Action("CreateNewEmployee", "HRM"))
        .Read(read => read.Action("Employee_Read", "HRM"))
        .Update(update => update.Action("Employee_Update", "HRM"))
        .Destroy(update => update.Action("Employee_Destroy", "HRM"))
    )
    .HtmlAttributes(new { style = "height:550px" })
)

No answers yet. Maybe you can help?

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