GridManager在处理数据时,需要使用规定的数据格式。而在实际场景中,或多或少存在一些格式差异。
在这里将对这些差异的处理方式进行说明
1、仅返回字段名不符
一级数据中的
data
与totals
, 可以使用dataKey
和totalsKey
进行调整。
后端返回数据为:
{
"list":[ // GridManager 期望返回的是 data, 而这里返回了 list
{
"name": "baukh",
"age": "28",
"createDate": "2015-03-12",
"info": "野生前端程序",
"operation": "修改"
},
{
"name": "baukh",
"age": "28",
"createDate": "2015-03-12",
"info": "野生前端程序",
"operation":