Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telerik MVC grid-How to Change "no record message" between ajax cals

Tags:

telerik-mvc

I am using Telerik MVC grid ajax binding to show some records. While the grid is loaded,the message in grid is "No records found". When ajax cal is complete,then the message goes and data is loaded. But this message of "No records found" till data is loaded is confusing to the user.

Can anyone tell me how to change this message as "Loading..." till the ajax cal is complete.

Thanks.

like image 979
SaurabhR Avatar asked Dec 22 '22 18:12

SaurabhR


2 Answers

Do a search for the t-no-data class in your grid. Something like

$('#ReportGrid').find('.t-no-data td').text('Loading...');

should go in your grid's onLoad()

like image 130
devrelm Avatar answered Apr 08 '23 01:04

devrelm


IMO, adding ".NoRecordsTemplate("Loading...")" to grid is better approach.

            @(Html.Telerik().Grid<RatingListItem>()
            .Name("Rating_Index_List")
            .Columns(columns =>
            {
                columns.Bound(o => o.Id).Hidden();
                columns.Bound(o => o.Score)
            })
            .DataBinding(dataBinding => dataBinding.Ajax().Select(Model.ListPageGridModel.DataRequestAction.ActionName, Model.ListPageGridModel.DataRequestAction.ControllerName))
            .Pageable(settings => settings.Total(Model.ListPageGridModel.TotalRow))
            .EnableCustomBinding(true)
            .Sortable()
            .NoRecordsTemplate("Loading...")
            )
like image 23
berdem Avatar answered Apr 08 '23 02:04

berdem