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

Client detail template grid not sending GET request

2 Answers 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 20 Dec 2016, 02:03 PM

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 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 22 Dec 2016, 11:35 AM
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.
0
Derek
Top achievements
Rank 1
answered on 09 Jan 2017, 10:56 AM
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.
Tags
Grid
Asked by
Derek
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Derek
Top achievements
Rank 1
Share this question
or