Question

I try to use itemSelector in extjs4.2 but i don't know i can configure two store. The first multiselect panel is populate by a store, and the second had another too.

I need to save the variation in a DB because the stores that i use is ajax-proxy datastore. This is my itemselector:

{
    xtype: 'itemselector',
    id:'itemselector',
    name:'userRoles',
    anchor:'100%',
    store: dsRoles,
    toStore: dsUserRoles,
    valueField:'id',
    displayField:'name',
    /*here there is a problem*/
    value: dsUserRoles,
    msgTarget: 'side',
    fromTitle : 'Available',
    toTitle : 'Selected'
}

The value in the 'Selected field' is coming from a query and is not static like in the all the example i found.

EDIT: the toStore property doesn't work, and today this component make me crazy: when i load the window which contain a tabPanel which contain the itemselector for the secondTime this is what is render: enter image description here Whith Chrome i found this error Uncaught TypeError: Cannot read property 'internalId' of undefined

Any help is helpfull.

Was it helpful?

Solution

Problem has been resolved! I changed the source code!(ItemSelector.js) here it is,

initComponent: function() {
    var me = this;

    me.ddGroup = me.id + '-dd';
    me.callParent();

    // bindStore must be called after the fromField has been created because
    // it copies records from our configured Store into the fromField's Store
    //me.bindStore(me.store);       //don't need to bind
},

createList: function(title, store){     //add a parameter named store
...
store: store,       //use the passed store
...
}
...
me.fromField = me.createList(me.fromTitle, me.store);
me.toField = me.createList(me.toTitle, me.toStore);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top