【发布时间】:2012-08-14 20:32:18
【问题描述】:
我收到以下服务器响应:
回调({ “数据”: [ { "id": "13_gnomodotiseis", “id1”:13, "title": "5/2009 ΓΝΜΔΕΙΣΑΠ 2009", "text": "5/2009 ΓΝΜΔΕΙΣΑΠ", “模型”:“gnomodotiseis”, "body": "σίλει...", “类型”:“文本”, “历史”:“旧”, “网址”:“”, "search_tag": "Γνωμοδοτήσεις", “新元素”:“真” } ], “数据集”: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从哪里弹出url?
我在这里缺少什么? Extjs4.1中的jsonP是如何工作的?
我真的需要这方面的帮助。
提前谢谢你,
汤姆
希腊
【问题讨论】:
标签: cross-domain jsonp extjs4.1