Reputation: 255
Can you please show me a sample code of loading image during data binding using telerik grid asp.net mvc Razor.
Thanks in advance.
Upvotes: 2
Views: 1932
Reputation: 1041
Check out the client events for OnDataBinding and OnDataBound. I would show a loading spinner when the OnDataBinding starts, then hide it again when the next method is called.
<%= Html.Telerik().Grid(Model)
.Name("Grid")
.ClientEvents(events => events.OnDataBinding("Grid_onDataBinding")
.OnDataBound("Grid_onDataBound")) %>
And then, the javascript would be:
function Grid_onDataBinding(e) {
$("#spinner").show();
}
function Grid_onDataBound(e) {
$("#spinner").hide();
}
Upvotes: 4