我開發ASP prorject在視圖中使用extjs。我有問題在EXTJS中使用ItemSelector。無法在ItemSelector中顯示Selected Item EXTJS 3
這是我的代碼:
var isForm = new Ext.Panel({
fieldLabel: 'Role',
width: 700,
bodyStyle: 'padding:10px;',
store: GroupStore,
//renderTo: 'itemselector',
items: [
{
xtype: 'itemselector',
name: 'itemselector',
fieldLabel: 'ItemSelector',
imagePath: '../../ExtResources/ux/images/',
multiselects: [{
legend: 'Available',
width: 250,
height: 200,
store: GroupStore,
displayField: 'groupName',
valueField: 'groupID'
}
, {
legend: 'Selected',
width: 250,
height: 200,
store: [['','']]
}]
}]
});
,這是我的商店:
var GroupStore = new Ext.data.JsonStore({
remoteSort: true,
root: 'data',
//autoLoad: loadStore2,
autoLoad: true,
totalProperty: 'totalCount',
idProperty: 'groupID',
fields: [{
name: 'groupID'
}, {
name: 'groupName'
}],
proxy: new Ext.data.HttpProxy({
//url: 'InputUserLoadHandler.ashx?get=groups&comp=HSO'
url: 'InputUserLoadHandler.ashx?get=groups'
})
});
在 '選定' 列不能顯示其已經選擇的項目。 我曾嘗試在「可用」列和「已選」中使用我的商店,但結果是已在雙方都顯示的項目。
this是reffrence我ItemSelector 請給我解決這個問題的解決方案......
我應該在哪裏放置商店?當我把它放入物品時,它被錯誤地反駁。消息是「對象爲空」 你能告訴我應該在哪裏放?感謝innerJL – indi60 2012-03-07 04:20:54
商店的數據格式給這個錯誤帶來了什麼影響? – indi60 2012-03-07 04:29:04
你可以發佈你的例子嗎?在jsfiddle例如?通過代碼很難說清楚。例如,您可以用簡單的數據陣列替換您的ajax數據。使用Json可以使用 – 2012-03-07 06:12:16