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

后端 未结 12 2179
栀梦
栀梦 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 09:52

    enter image description here

     // Kendo Grid
             dataSource: dataSource,
             dataBound:gridDataBound,
    
    
    
    //No data in the grid show message
            function gridDataBound(e) {
                var grid = e.sender;
                if (grid.dataSource.total() == 0) {
                    var colCount = grid.columns.length;
                    $(e.sender.wrapper)
                        .find('tbody')
                        .append('There is no data to show in the grid.');
                }
            };
    

提交回复
热议问题