Kendo UI MVC Grid and backend problem

Posted by Community Admin on 05-Aug-2018 14:55

Kendo UI MVC Grid and backend problem

All Replies

Posted by Community Admin on 26-Jun-2017 00:00

We are running into an issue using Kendo ui MVC and sitefinities backend. We have created a widget that shows data in a grid.

@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@using Telerik.Sitefinity.Modules.Pages
@using Kendo.Mvc.UI;
@model List<ECOnX.Infrastructure.Models.Container>
 
<head>  
    <script src="@Url.Content("~/scripts/kendo.modernizr.custom.js")"></script>
    <meta charset="utf-8" />
</head>
 
    @(Html.Kendo().Grid<ECOnX.Infrastructure.Models.Container>()
        .Name("grid")
        .Columns(columns =>
        
            columns.Bound(c => c.ID)
            .Title("ID")
            .Filterable(false)
            .ClientTemplate("<a href='" + Url.Action("ContainerDetails", "ContainerGridController") + "#= ID #'" + ">Details</a>");
            columns.Bound(c => c.Name);
            columns.Bound(c => c.Address.City);
            columns.Bound(c => c.Address.Street);
            columns.Bound(c => c.ContainerDatas.Last().NumberOfPressings);
            columns.Bound(c => c.ContainerDatas.Last().IsLocked);
            columns.Bound(c => c.EMEINumber);
        )
        .HtmlAttributes(new style = "height: 550px;" )
        .Scrollable()
        .Groupable()
        .Sortable()
        .Pageable(pageable => pageable
            .Refresh(true)
            .PageSizes(true)
            .ButtonCount(5))
        .DataSource(dataSource => dataSource
       .Ajax().Read(r => r.Action("Containers_Read", "ContainerGridController")).PageSize(20)
        )
    )

 

Like this it works as it should in the frontend. If we create a page in the backend with this widget on it and we try to edit it later nothing on the edit page works we can not go back or change the controls anymore. We have found out it is related to jquery which is also loaded in the widget itso. So if we remove the line

The backend works again but we no longer get data on the page anymore. What do we need to put in the widget so both the front and backend of the application keep working?

 

 

 

This thread is closed