如何从json创建表列和字段? (动态网格) [英] How do you create table columns and fields from json? (Dynamic Grid)

查看:151
本文介绍了如何从json创建表列和字段? (动态网格)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个json文件,我假设我不知道内容的内容。我不知道这个模型。但是在json文件中给出了有关网格的模型,数据和其他信息。如何以这种方式创建列等?

I have a json file and I assume that I do not know anyting about the content. I do not know the model. However it is given in the json file the model, the data, and other information about the grid. How I'll create the columns etc in this way?

推荐答案

http://docs.sencha.com/ext-js/4-1/#!/ api / Ext.data.reader.Json - >响应MetaData部分

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.reader.Json -> Response MetaData section

在网格中不要忘记添加这一个列:[],然后在商店下面 listeners:{'metachange':function(store,meta){myGrid.reconfigure(store,meta.columns); }} 并且响应json文件应该具有带有字段和列的metaData。有关详细信息,请参阅文档中的 Response MetaData 部分。

in the grid don't forget to add this one columns: [], then under the store listeners: { 'metachange': function(store, meta) { myGrid.reconfigure(store, meta.columns); } } and the response json file should have metaData with fields and columns. Read Response MetaData section in the documentation for more info.

这篇关于如何从json创建表列和字段? (动态网格)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆