PDA

View Full Version : ItemSelector with two datastores



amits0184
4 Mar 2013, 4:20 AM
HI,

I need to create itemselector with two datastores.
fromData : dataStore1,
toData: dataStore2.

I am not able to create itemselector with 2 datastores, its showing error -"store.autoCreated is null or not an object". I am using "Internet explorer 8".

Can you please help me or send me some examples.
I got 2-3 examples on the internet but they are not working.

I am using Ext JS version - Ext JS -4.1.1

Thanks in advance

Thanke & regards
Amit

mitchellsimoens
6 Mar 2013, 7:37 AM
The toField's store is created for you, you just pass in 1 store and it will create the other based on the value of the ItemSelector:


var ds = Ext.create('Ext.data.Store', {
fields : ['value', 'text'],
data : [
{ text : 'One', value : 1 },
{ text : 'Two', value : 2 },
{ text : 'Three', value : 3 },
{ text : 'Four', value : 4 },
{ text : 'Five', value : 5 }
]
});

new Ext.form.Panel({
renderTo : document.body,
title : 'Test',
items : [
{
xtype : 'itemselector',
name : 'itemselector',
id : 'itemselector-field',
anchor : '100%',
fieldLabel : 'ItemSelector',
imagePath : '../ux/images/',
store : ds,
displayField : 'text',
valueField : 'value',
value : [2, 4, 5],
allowBlank : false,
msgTarget : 'side',
fromTitle : 'Available',
toTitle : 'Selected'
}
]
});