-----------------------------------------------------------------------------------------------------------------
jquery.easyui.min.js:8853 Uncaught TypeError: Cannot read property 'data' of undefined at Object.getData (jquery.easyui.min.js:8853) at init.$.fn.datagrid (jquery.easyui.min.js:8610) at board_list_datagrid_onLoadSuccess (eval at globalEval (jquery.min.js:1), <anonymous>:4:73) at eval(eval at parseOptions (jquery.easyui.min.js:51), <anonymous>:2:23) at Object.parseOptions (jquery.easyui.min.js:51) at Function.$.fn.panel.parseOptions (jquery.easyui.min.js:2989) at Function.$.fn.datagrid.parseOptions (jquery.easyui.min.js:9001) at HTMLTableElement.<anonymous> (jquery.easyui.min.js:8620) at Function.each (jquery.min.js:1) at init.each (jquery.min.js:1)
问题已经找到,数据还没加载,通过下面获取不到
var data = $("#proPurGoodsTotalDemand_list_datagrid_wholesale_").datagrid("getData");
解决方法:
data-options="onLoadSuccess:function(data){ board_list_datagrid_onLoadSuccess(,data) }"
onLoadSuccess会传一个data参数