EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: roberto on January 03, 2020, 05:21:19 AM



Title: emptyMsg
Post by: roberto on January 03, 2020, 05:21:19 AM
Is there a way to show the emptyMsg at the center of datagrid?


Title: Re: emptyMsg
Post by: jarry on January 04, 2020, 03:53:28 AM
Please custom the datagrid view and override the 'setEmptyMsg' method.
Code:
var myview = $.extend({}, $.fn.datagrid.defaults.view, {
setEmptyMsg: function(target){
var state = $.data(target, 'datagrid');
$.fn.datagrid.defaults.view.setEmptyMsg.call(this, target);
state.dc.view.children('.datagrid-empty').css('top', '50%');
}
})
$(function(){
$('#dg').datagrid({
view: myview,
emptyMsg: 'no records'
})
})


Title: Re: emptyMsg
Post by: roberto on January 04, 2020, 11:28:11 AM
tanks :)