0
好了,所以我有一個擴展Ext.dataview.component.DataItem'
我有這個功能煎茶觸摸component.DataItem動態列表
onNameButtonTap: function(button, e) {
var record = this.getRecord();
console.log("The tid of this record is: " + record.get('tid'));
}
我能夠從這個水龍頭,我想用得到tid
背視圖加載一個新視圖,該視圖將使用此ID來更改代理網址以獲取不同的數據。下面是這個視圖:
Ext.define('AIN.view.Headlines.Card', {
extend: 'Ext.NavigationView',
xtype: 'headlineContainer',
config: {
tab: {
title: 'Headlines',
iconCls: 'star',
action: 'headlinesTab'
},
autoDestroy: false,
items: [
{
xtype: 'headlines',
store: 'Headlines',
}
]
}
});
我該如何獲得URL參數在我的商店接受這樣一個 'http://mywebsite.com/app-feeds/channels/' + tid
感謝您的閱讀一個網址,我是新來這個和谷歌搜索小時後我無法弄清楚這一點。
更新,這是爲我工作。
var store = Ext.StoreMgr.get('Headlines');
store: store.setProxy({
type: 'jsonp',
url: 'http://awebsite.com/app-feeds/channels/' + tid,
reader: {
type: 'json',
rootProperty: 'nodes',
record: 'node'
}
}).load()
感謝您的回覆jprofitt,我剛剛更新我的OP與一些代碼,這對我的工作。你能快速看一下,讓我知道這是否是根本錯誤的做法? (因爲它可能是)。謝謝 – EvWill
我建議的唯一事情就是在'Controller'而不是視圖中對代理進行操作。 – jprofitt