我正在学习 ExtJS-4.2,我正在关注他们的 MVC 教程......
我构建了我的控制器、视图、模型、商店……我的商店有硬编码的数据。我有一个用于测试的有效 WebAPI,它以 json 格式发送结果......
本教程正在讨论如何从本地文件中读取并发送到 API,
我想从 API 中读取什么并将我的数据加载到商店中......
Ext.define('AM.store.Productstore',
{
extend : 'Ext.data.Store',
model : 'AM.model.Productmodel',
autoload : true,
proxy : {
type : 'AJAX',
url : 'localhost/mfw/api/products/all'
//tutorial is no help any furthur from this point on
}
});
我的网址是localhost/mfw/api/products/all
我返回的 json 是
[{"ID":1,"Name":"aa","Category":"A","Price":200.00},
{"ID":2,"Name":"bb","Category":"B","Price":200.00
{"ID":3,"Name":"cc","Category":"C","Price":200.00},
{"ID":4,"Name":"dd","Category":"D","Price":200.00},
{"ID":5,"Name":"ee","Category":"E","Price":200.00},
{"ID":6,"Name":"ee","Category":"F","Price":200.00}]
有什么帮助吗?