我得到以下服务器响应:
回调({“数据”:[{“id”:“13_gnomodotiseis”,“id1”:13,“标题”:“5/2009 ΓΝΜΔΕΙΣΑΠ 2009”,“文本”:“5/2009 ΓΝΜΔΕΙΣΑΠ”,“模型": "gnomodotiseis", "body": "σίλει...", "type": "text", "history": "old", "url": "", "search_tag": "Γνωμοδοτήσεις", "new_element ": "真" } ], "数据集": 1 })
我有一个这样的商店定义:
var baseUrl = 'http://localhost:8090/';
Ext.define('Ktimatologio.store.NewSingleBlockStore', {
extend: 'Ext.data.Store',
alias: 'widget.newsingleblockstore',
requires: ['Ktimatologio.model.NewSingleBlockModel'],
model: 'Ktimatologio.model.NewSingleBlockModel',
groupField: 'search_tag',
fields: [
{name:'id', mapping:'id'},
{name:'id1', mapping:'id1'},
{name: 'text', mapping: 'text'},
{name: 'title', mapping: 'title'},
{name: 'fek', mapping: 'fek'},
{name: 'date', mapping: 'date'},
{name: 'descr', mapping: 'description'},
{name: 'model', mapping: 'model'},
{name: 'body', mapping: 'body'},
{name: 'type', mapping: 'type'},
{name: 'history', mapping: 'history'},
{name: 'src', mapping: 'url'},
{name: 'search_tag', mapping: 'search_tag'},
{name: 'new_element', mapping: 'new_element'},
{name: 'new_table', mapping: 'new_table'}
],
autoLoad: true,
proxy: {
//type:'ajax',
type:'jsonp',
url: baseUrl + 'openbd/ktimatologio-final/resources/cfScripts/nea_stoixeia/GetNews.cfc?',
callbackKey: 'callback',
extraParams: {
method: 'jsonP'
},
reader:{
type: 'json',
root: 'data'
}
}
});
我在萤火虫中看到的网址:
http://localhost:8090/openbd/ktimatologio-final/resources/cfScripts/nea_stoixeia/GetNews.cfc?&_dc=1345305032559&method=jsonP&page=1&start=0&limit=25&group=[{"property"%3A"search_tag"%2C"direction "%3A"ASC"}]&sort=[{"property"%3A"search_tag"%2C"direction"%3A"ASC"}]&callback=Ext.data.JsonP.callback2
Firebug 给我错误:“ReferenceError:未定义回调”
我的问题是:
Ext.data.JsonP.callback2 是从哪里弹出来的?
我在这里想念什么?Extjs4.1 中的 jsonP 是如何工作的?
我真的需要这方面的帮助。
先感谢您,
汤姆
希腊