easyui的datagrid展示的数据格式

easyui的datagrid显示的数据格式

easyui前台显示数据可以使用JSONObject,也可以使用JSONArray。

但是如果是datagrid表格中的数据显示,只能使用JSONObject,这是easyui的规范。

后台会将查询出的List使用JSONArray.fromObject()方法将List转换成JSONArray,但如果是在datagrid的表格中显示,则需要将JSONArray  put到JSONobject中;如果不用在datagrid表格中显示,那么JSONObject和JSONArray都可以传递给前台值。