标签:options ons top default -- idt get blog remove
var myview = $.extend({},$.fn.datagrid.defaults.view,{ onAfterRender:function(target){ $.fn.datagrid.defaults.view.onAfterRender.call(this,target); var opts = $(target).datagrid(‘options‘); var vc = $(target).datagrid(‘getPanel‘).children(‘div.datagrid-view‘); vc.children(‘div.datagrid-empty‘).remove(); if (!$(target).datagrid(‘getRows‘).length){ var d = $(‘<div class="datagrid-empty"></div>‘).html(opts.emptyMsg || ‘no records‘).appendTo(vc); d.css({ position:‘absolute‘, left:0, top:50, width:‘100%‘, textAlign:‘center‘ }); } } });
1 $(‘#dg‘).datagrid({ 2 view: myview, 3 emptyMsg: ‘no records found‘ 4 });
扩展当easyui datagrid无数据时,显示特定值。如:没有数据 ----转载
标签:options ons top default -- idt get blog remove
原文地址:http://www.cnblogs.com/871735097-/p/5992347.html