This is a migrated thread and some comments may be shown as answers.
Custom Ajax binding with client events
0 Answers 21 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tx3
Top achievements
Rank 1
Tx3 asked on 27 Jan 2012, 08:52 AM
Hi!

I am using version 2011.2.712 Grid control and my problem is that OnDataBound event is triggered only on the initial grid data loading. Nothing is happening on paging even thou data is loaded from the controller action.

How can I execute on a javascript function when new data is actually loaded? Is this fixed in the newer versions?

@using System.Configuration
@using xxx
@model BaseGridList
            
@(Html.Telerik().Grid(Model.Rows)
    .Name(Model.GridId)
    .EnableCustomBinding(true)
    .DataKeys(keys => keys.Add("AnimalId"))
    .Columns(columns => columns.Bound("AnimalId")
                   .ClientTemplate("<input type='checkbox' class='grid-checkbox' value='<#= AnimalId #>' />")
                   .Title("Check")
                   .Width(50)
                   .HtmlAttributes(new { style = "text-align:center" }))
    .Columns(columns => columns.LoadSettings(Model.ColumnSettings))
    .DataBinding(dataBinding => dataBinding.Ajax().Select(Model.SelectAction, Model.SelectController))
    .ClientEvents(events => events
        .OnLoad("gridOnLoad('" + Model.GridId + "')")
        .OnDataBound("alert('test')")) <--- triggered only once
    .Sortable()
    .Pageable()
    .HtmlAttributes(new { @class = "xxx" })
    .Scrollable(c => c.Height(Model.GridHeight + "px"))
      )

Thanks,
Tatu
Tags
Grid
Asked by
Tx3
Top achievements
Rank 1
Share this question
or