v3.0.2版本的datagrid自定义数据返回参数名

提问 未结 4 4500
悬赏:20飞吻
oadFilter: function (a) {
console.log(a);
console.log( void 0 == a.rows)
"undefined" == typeof a && (a = {}), a.total = a[topJUI.config.datagrid.total] ? a[topJUI.config.datagrid.total] : a.length, void 0 == a.total && (a.total = 0);
void 0 == a.rows ? a.rows = [] : a.rows = a[topJUI.config.datagrid.rows] ? a[topJUI.config.datagrid.rows] : a.rows;
a.footer = a.footer ? a.footer : [];
console.log(a);
return a
}
这里 void 0 == a.rows 的这个判断写死了 后台返回必须要有rows参数名?
如下定义是不会返回rows参数名
var myConfig = {
config: {
pkName: 'id', //数据表主键名,用于批量提交数据时获取主键值
singleQuotesParam: true, //是否对批量提交表格选中记录的参数值使用单引号,默认为false,true:'123','456',false:123,456
datagrid: {
page: 'page', //提交到后台的显示第几页的数据
size: 'data', //提交到后台的每页显示多少条记录
total: 'total', //后台返回的总记录数参数名
rows: 'data' //后台返回的数据行对象参数名
},
另外这个自定义参数名不支持多级?
回帖
回帖须知