0
{
    xtype: 'itemselector',
    name: 'psa_id',
    id: 'psa_id',
    store: all_psa_store,
    displayField: 'refrence',
    valueField: 'mspa_id',
    **value: [23,56],
    //howtoloadthisfromstore**allowBlank: true,
    msgTarget: 'side',
    toTitle: '<fontcolor="blue">GAMSelected</font>',
    fromTitle: '<fontcolor="green">GAMAvailable</font>'

}

4

1 回答 1

1

监听你的 itemselector 的 afterrender 事件。在回调中加载包含优先 id 的商店。

this.control({
    '#youritemselector' : {
        afterrender : this.reloadItemSelector
    }
});

...

reloadItemSelector: function(itemselector) {
    yourPriorityStore.load(function() {
        var selected = [];
        Ext.each(yourPriorityStore.data.items, function(item) {
            selected.push(item['data']['id']);
        });

        itemselector.setValue(selected);
    });
}
于 2013-08-09T11:41:48.317 回答