- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有一个 JSON 存储,我想将其自动加载到 grid.panel 中。不幸的是,在它完成异步获取后,网格中没有填充任何内容。 Firebug 显示 JSON 已成功检索。
商店:
var datasetStore = new Ext.data.JsonStore({
root: 'rows',
fields: ['griddap', 'Subset', 'tabledap', 'Make A Graph', 'wms', 'Title', 'Summary', 'Info', 'Background Info', 'RSS', 'Email', 'Institution', 'Dataset ID'],
proxy: new Ext.data.HttpProxy({
url: 'http://localhost:8080/proxy.php?u=http://coastwatch.pfeg.noaa.gov/erddap/info/index.json'
}),
autoLoad: true
});
网格:
var datasetListingGridPanel = new Ext.grid.GridPanel({
id: 'datasetListingGridPanel',
preventHeader: true,
store: datasetStore,
layout: 'fit',
viewConfig: {
forceFit:true,
fitcontainer:true
},
columns:
[
{
header: 'Dataset Title',
dataIndex: 'Title'
}
]
});
编辑 - JSON
{
"table": {
"columnNames": ["griddap", "Subset", "tabledap", "Make A Graph", "wms", "Title", "Summary", "Info", "Background Info", "RSS", "Email", "Institution", "Dataset ID"],
"columnTypes": ["String", "String", "String", "String", "String", "String", "String", "String", "String", "String", "String", "String", "String"],
"rows": [
["", "", "", "", "", "", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", "", "", "", "", "", ""]
]
}
}
我取出了值,因为它们很长。
有什么问题吗?
最佳答案
由于您使用的是 JsonStore,很明显您仍在使用 ExtJS-3(而不是 4),因此以下链接仍然相关:
http://www.sencha.com/learn/grid-faq/
也就是说,查看您的 JSON,问题是您指定的根“行”不是 顶级 级属性:而是嵌套在“表”中属性(property)。
另见:extJS: reading a nested JSON
反过来又引用了这个:http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.JsonReader
下面是一些选项:
关于javascript - EXTJS 异步get后加载JSONStore到grid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8245992/
我在 Android 中的 JSONStore 初始化函数中遇到问题。它会挂起大约 10 分钟,直到 JSONStore 给我初始结果回调。这确实只发生在 Android 和 iPhone 工作正常。
当我初始化 JSONSTORE 的函数时,出现错误 java.lang.NoClassDefFoundError: com.worklight.jsonstore.util.JSONStoreUtil
我的 JsonStore 是这样定义的: var data_json = new Ext.data.JsonStore({ url: '/Game/json_index', autoL
我的 JsonStore 是这样定义的: var data_json = new Ext.data.JsonStore({ url: '/Game/json_index', autoL
我正在尝试学习 JSONStore 并在此过程中尝试执行一段代码,该代码将首先检查设备中是否已经存在特定的 JSONStore,并根据结果执行 if-else陈述。如果不存在,它将创建一个并在其中添加
我有一个 jsonstore: jstore = new Ext.data.JsonStore({ fields: ['id', 'timer', 'name', 'message'],
团队, 我有一个 jsonstore 来加载我的列表。我正在使用内联数据加载商店,无需任何代理配置。我想调用我商店的加载事件。请告诉我该怎么做。 以下是我的商店代码: Store = new Ext.
JSONStore 为我们提供了一种与服务器同步数据并跟踪用户离线时所做更改的好方法。 JSONStore 上可以保存多少信息是否有限制?我发现 Webkit 数据库有 5 MB 的限制,而 SQLL
我想动态生成列表条目,同时将它们作为 jsonstore 文档添加到我的本地存储。 当我这样做时: var j=0; while(j').attr({attributes}).
编写一个函数来生成一些随机数据并将其推送到未知传递的数据存储对象中。我知道我可以遍历记录然后遍历字段,但在开始将随机生成的记录推送到其他记录顶部之前我需要有字段列表(然后删除最后一项以模拟实时图表)。
我的 JsonStore 似乎没有填充。当我运行代码时,它会触发请求,该请求会返回 json。当我检查数据存储时,数据数组为空。 我错过了什么?谢谢。 我定义了这个 JsonStore: CCList
你能帮我解决我在使用 loadData 函数作为 Ext.data.JsonStore 的一部分时遇到的问题吗?我已经创建了一个我遇到的问题的基本示例: Ext JSON ex
我想使用 for 循环添加到 JSONStore 所以我在 for 中调用了长度超过 500 的 saveToJSON() 函数,但它没有添加,并且在控制台中它显示成功但是当我查看 jsonstore
我正在尝试使用 loadData 方法在 JSONStore 中加载数据,但它仅在存储中加载单个记录。这是代码片段 var myRecord = Ext.data.Record.create([
我正在尝试实现 ExtJS 和 Java 之间的通信我正在将请求从 ExtJS 发送到使用 netty 的 Java 服务器。如果有人可以向我发送一个示例,说明如何从 Java 端格式化响应以及如何从
我想从另一个面板用户 js 文件访问由 ext 设计器创建的 JsonStore。设计器生成的文件存储文件如下所示 myJsonStore = Ext.extend(Ext.data.JsonStor
我根据 this question 创建了一个 GUI在尝试自学如何使用 jsonstore 的同时。我没有添加评论的声誉点,所以我在这里问我的问题。我想我已经掌握了基本的想法,但由于某种原因我无法将
我正在尝试使用 POST 请求调用 API。但是我的 Chrome Inspector 在网络选项卡中显示了 method='GET'... 这是我的代码: Ext.define('TestItem'
我实现了JSONStore同步过程如下: 1.将本地修改推送到服务器 2.如果推送数据成功,则清除所有现有的本地数据。 3.从服务器加载新的数据副本。 我想知道这个数据同步过程是不是一个好方法? 如果
我有一个 EXtJS Web 应用程序,它以 json 格式返回数据。结果在 ExtJS Grid 中分页显示,并由 pagingToolbar 处理。我正在使用 sliderPager 插件来选择页
我是一名优秀的程序员,十分优秀!