Client detail template grid not sending GET request

3 posts, 0 answers
  1. Derek
    Derek avatar
    3 posts
    Member since:
    Apr 2016

    Posted 20 Dec 2016 Link to this post

    Here is the code for my parent grid.

    @(Html.Kendo().Grid<Wcs.Applications.Web.SoldevPortal.Models.NetworkMap.ManagementNetworks.ManagementNetworkViewModel>()
        .Name("ManagementNetworkGrid")
        .Columns(columns =>
        {
            columns.Bound(c => c.IpNetworkAddress);
            columns.Bound(c => c.IpSubnetMask);
            columns.Bound(c => c.DevicesDiscovered);
            columns.Bound(c => c.DevicesPolled);
            columns.Command(command => { command.Custom("Poll").Click("poll"); command.Edit(); command.Destroy(); });
        })
        .ToolBar(toolbar =>
        {
            toolbar.Create();
        })
        .Editable(editable => editable.Mode(GridEditMode.InLine))
        .ClientDetailTemplateId("managementNetworkDetail")
        .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model =>
            {
                model.Id(m => m.IpNetworkAddress);
                model.Field(m => m.DevicesDiscovered).Editable(false);
                model.Field(m => m.DevicesPolled).Editable(false);
            })
            .Create(create => create.Action("ManagementNetworks_Create", "NetworkMap").Data("AttachAntiForgeryToken"))
            .Read(read => read.Action("ManagementNetworks_Read", "NetworkMap"))
            .Update(update => update.Action("ManagementNetworks_Update", "NetworkMap").Data("AttachAntiForgeryToken"))
            .Destroy(destroy => destroy.Action("ManagementNetworks_Destroy", "NetworkMap").Data("AttachAntiForgeryToken"))
            .PageSize(20)
            .Sort(sort => sort.Add(s => s.IpNetworkAddress).Ascending())
        )
    )

     

    And here is the code for my client detail template grid.

    <script id="managementNetworkDetail" type="text/kendo-tmpl">
        @(Html.Kendo().Grid<Wcs.Applications.Web.SoldevPortal.Models.NetworkMap.ManagementNetworks.ManagementNetworkDetailViewModel>()
            .Name("ManagementNetworkGrid_#=IpNetworkAddress#")
            .Columns(columns =>
            {
                columns.Bound(c => c.NetworkDeviceId);
                columns.Bound(c => c.Name);
                columns.Bound(c => c.Description);
                columns.Bound(c => c.EthernetInterfaces);
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("ManagementNetworks_Detail", "NetworkMap", new { ipNetworkAddress = "#=IpNetworkAddress#" }))
                .Sort(sort => sort.Add(s => s.NetworkDeviceId).Ascending())
            )
            .ToClientTemplate()
        )
    </script>

     

    However when I expand a row in the parent grid, there is no data in the child grid. Looking at the Network tab in my browser's debug tools, I can see that no GET request is being sent. There are no errors in the browser's console. Hopefully someone can help me get to the bottom of what I'm doing wrong.

    Thanks in advance.

  2. Vasil
    Admin
    Vasil avatar
    1599 posts

    Posted 22 Dec 2016 Link to this post

    Hello Derek,

    The configuration looks correct, and there is not obvious reason for the detail grid to skip binding.

    Could you confirm that you are using the latest version of the controls.
    Is request made when you sort the grid inside the detail template?

    Regards,
    Vasil
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Derek
    Derek avatar
    3 posts
    Member since:
    Apr 2016

    Posted 09 Jan in reply to Vasil Link to this post

    Hello Vasil, thank you for your response. I believe I have resolved the issue. The IpNetworkAddress property stores an IP address in dotted-decimal notation, and I believe the dots were causing an issue. I added a new property to the model that stores the IP address as an int and used this as the key instead, and now the grid is operating as expected.
Back to Top