0
は私のモデルとストア、煎茶タッチselectfield項目選択問題
Ext.regModel('Agent', { fields: [{ name: 'userid', type: 'int' }, { name: 'agentname', type: 'string'}] });
App.stores.agentStore = new Ext.data.Store({
model: 'Agent',
storeId: 'AgentsStoreid',
proxy: {
type: 'ajax',
url: 'https://abc123.com/wsbrightdoor.asmx/GetAgents?username=abc&password=123',
reader: { type: 'xml', root: 'root', record: 'salesagent' }
},
autoLoad: true
});
//App.stores.agentStore.load();
console.log(App.stores.agentStore);
である私は、ここでは、この
var sel = new Ext.form.Select(
{
id: 'Myselectfield',
name: 'myagent',
label: 'Agent',
store: App.stores.agentStore,
displayField: 'agentname',
valueFiels: 'userid',
placeHolder: 'Click/touch to select options...',
});
ように私のSelectItemにこのストアを設定しています私のXMLファイルであるサーバが
を返します。<?xml version="1.0" encoding="utf-8"?>
<root>
<salesagent>
<userid>1</userid>
<agentname>Name1</agentname>
</salesagent>
<salesagent>
<userid>13</userid>
<agentname>Name2</agentname>
</salesagent>
</root>
ストアがWebサーバーから値を取得しているのがわかります。エージェント名とユーザーIDを持つデータオブジェクトが表示されます値。 Sencha touch 1.1.0を使用しています。私は今、Webサービスから移入されselectfield内の値を見ることができます。私は項目を選択すると、選択した項目は、私が選択した項目に変更されていません。選択したように私は私の店の最初の要素を参照してください。これをどのように修正するのですか?提案してください。