PDA

View Full Version : Not able to load itemselector



amanind
21 Jul 2010, 11:07 PM
After ajax call I got data in array and called the below function, Now what i have to do to show data in itemselector

loadInvestMultilist: function() {
var investData = arguments[0].reportData;
this.fromStore = new Ext.data.Store({
id: 'fromStore',
data: investData,
reader: new Ext.data.JsonReader(
{
id: 'Id'
},
Ext.data.Record.create([
{ name: 'Id', mapping: 'Id' },
{ name: 'Name', mapping: 'Name' }
])
)
});
this.toStore = new Ext.data.Store({
id: 'toStore',
data: this,
reader: new Ext.data.JsonReader(
{
id: 'Id'
},
Ext.data.Record.create([
{ name: 'Id', mapping: 'Id' },
{ name: 'Name', mapping: 'Name' }
])
)
});
}


here is code for my itemselector

items: {
xtype: 'itemselector',
name: 'investSelector',
id: 'investSelector',
imagePath: "ExtLib/plugins/images/",
imagePath: Module.getEnv('EXTUX_MULTISELECT_PATH')+"images/",
drawUpIcon: false,
drawDownIcon: false,
drawTopIcon: false,
drawBotIcon: false,
width: 400,
height: 180,
multiselects: [{
width: 150,
height: 150,
legend: " ",
draggable:false,
droppable:false,
store:this.fromStore,
displayField: 'Name',
valueField: 'Id'
},{
width: 150,
height: 150,
legend: " ",
draggable:false,
droppable:false,
store: this.toStore,//[["0", "All"]],
displayField: 'Name',
valueField: 'Id'
}]
}