Display a message within the Kendo grid when it's empty

后端 未结 12 2181
栀梦
栀梦 2020-12-13 09:27

I\'m trying to display a friendly message (like \"No records found, try again later\") within the grid content, when there are no records in the database.

F

12条回答
  •  旧巷少年郎
    2020-12-13 10:03

    On Grid Data Bound..

    Add the following script to show Message.

     //ondatabound on user assginment grid grid
        function onUserAssignGridDataBound(e) {
    
            //Get the number of Columns in the grid
            var colCount = $("#UserAssignGrid").find('.k-grid-header colgroup > col').length;
    
            //If There are no results place an indicator row
            if ($("#UserAssignGrid").data("kendoGrid").dataSource._view.length == 0) {
                $("#UserAssignGrid").find('.k-grid-content tbody')
                    .append('No Results Found!');
    
            }
    

提交回复
热议问题