Last active
December 16, 2015 07:09
-
-
Save zacker330/5396356 to your computer and use it in GitHub Desktop.
easyui datagrid的扩展
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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