This question is locked. New answers and comments are not allowed.
Hi, I'm having some trouble using both Ajax requests and Client-side events.
In the below block of code, uncommenting the ".ClientEvents" part causes the ajax to stop working. Sorting by column reloads the whole page, filtering is impossible, and the delete links no longer function properly. As is, however - with the ClientEvent part commented out - they all work fine.
The "updateTitle" script updates the text in the page's header, which contains a count of how many records are currently in the grid.
Please let me know if you need me to paste more code/provide additional info.
Thanks for any help,
Luke
btw, I came across this question which sounds similar, but I'm not certain if it's a related issue:
http://www.telerik.com/community/forums/aspnet-mvc/grid/client-events-prevents-ajax-select-from-working.aspx
In the below block of code, uncommenting the ".ClientEvents" part causes the ajax to stop working. Sorting by column reloads the whole page, filtering is impossible, and the delete links no longer function properly. As is, however - with the ClientEvent part commented out - they all work fine.
@(Html.Telerik().Grid(Model) .Name("Grid") .DataKeys(dataKeys => dataKeys.Add(o => o.Id)) .Columns(columns => { columns.Command(commands => commands.Delete()).Width(50); columns.Bound(o => o.Info.Name).Title("Name").Width(100); columns.Bound(o => o.Info.LastUserName).Title("User name").Width(50); columns.Bound(o => o.Info.Model).Title("Device model").Width(100); columns.Bound(o => o.Info.PushNotificationTypes).Title("Notification").Width(50); columns.Bound(o => o.Info.PhoneNumber).Title("Phone number").Width(100); columns.Bound(o => o.Info.OSVersion).Title("OS version").Width(50); columns.Bound(o => o.Info.SoftwareVersion).Title("Client version").Width(100); columns.Bound(o => o.Info.LastAccess).Title("Last logon").Width(100); columns.Bound(o => o.Info.LastNotification).Title("Last notification").Width(100); }) .DataBinding(dataBinding => { dataBinding.Server().Select("Devices", "Monitoring", new { ajax = true }); dataBinding.Ajax() .Select("_Devices", "Monitoring") .Delete("_DevicesDelete", "Monitoring"); }) /*.ClientEvents(events =>events .OnDataBound("updateTitle"))*/ .Scrollable(scrolling => scrolling.Enabled(true)) .Sortable(sorting => sorting.Enabled(true)) .Pageable(paging => paging.Enabled(true)) .Filterable(filtering => filtering.Enabled(true)) .Groupable(grouping => grouping.Enabled(true)) .Footer(true) )The "updateTitle" script updates the text in the page's header, which contains a count of how many records are currently in the grid.
Please let me know if you need me to paste more code/provide additional info.
Thanks for any help,
Luke
btw, I came across this question which sounds similar, but I'm not certain if it's a related issue:
http://www.telerik.com/community/forums/aspnet-mvc/grid/client-events-prevents-ajax-select-from-working.aspx