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

Editor in seperate view

1 Answer 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chrys
Top achievements
Rank 1
Chrys asked on 11 Jun 2013, 08:44 PM
Is there a way to edit grid rows in a separate view. I need to accomplish this because the modal has too much information so it needs to be displayed in a separate view.

grid.bind("edit", function (e) {
                window.location = '@Url.Action("AddEditCoalition","Form",new{coalitionId=Model.CoalitionId})' + '&formId=' + e.model.Id;
});
The only problem is the modal shows up is there anyway to do this without the modal showing at all and it goes stratight to the seperate view?

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 13 Jun 2013, 07:04 AM
Hello Chrys,

A more appropriate way to navigate to a separate view will be to use a custom command and to handle its click event in which to navigate to the other page:

@(Html.Kendo().Grid<Model>()   
    .Name("Grid")
    .Columns(columns => {   
        /*...*/
        columns.Command(command => command.Custom("Edit").Click("showEditForm"));
    })   
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(/*..*/)
     )
)
 
<script type="text/javascript">
    function showEditForm(e) {
        e.preventDefault();
                 
        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
 
        window.location.href = '@Url.Action("AddEditCoalition","Form",new{coalitionId=Model.CoalitionId})' + '&formId=' + dataItem.Id;
    }
</script>


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