Skip to content

Instantly share code, notes, and snippets.

@zacker330
Last active December 16, 2015 07:09
Show Gist options
  • Save zacker330/5396356 to your computer and use it in GitHub Desktop.
Save zacker330/5396356 to your computer and use it in GitHub Desktop.
easyui datagrid的扩展
/**
* datagrid的扩展
*/
$.extend($.fn.datagrid.defaults, {
onLoadSuccess: function (data) {
if (!data || !data.rows || data.rows.length == 0) {
var body = $(this).data().datagrid.dc.body2;
var columns = $(this).data().datagrid.options.columns;
var columns_length = columns.length;
var colspan = columns[ columns_length > 0 ? columns_length - 1 : 0].length;
body.find('table tbody').append('<tr><td width="' + body.width() + '" style="height: 25px; text-align: center;" colspan="'+ colspan +'">没有数据</td></tr>');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment