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

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

问题描述

我有一个 json 文件,我假设我对内容一无所知.我不知道型号.然而,它在 json 文件中给出了模型、数据和有关网格的其他信息.我将如何以这种方式创建列等?

解决方案

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

在网格中不要忘记添加这个 columns: [], 然后在 store 下 listeners: { 'metachange': function(store, meta) { myGrid.reconfigure(商店,元.列);} } 和响应 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 -> Response MetaData section

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天全站免登陆