Affichage des articles dont le libellé est multiple instances of store in controller. Afficher tous les articles
Affichage des articles dont le libellé est multiple instances of store in controller. Afficher tous les articles

vendredi 31 octobre 2014

multiple instances of store in controller

hi experts

I am trying to instantiate a grid component in my accordion


In my controller i am doing


Ext.each(Items, function(Item, index) {

Ext.Ajax.request({

loadMask : true,

url : 'getByNew.controller',

method : 'GET',

params: {

Id: Id,


},

scope : this,

success : function(response, callOptions) {

var Data = Ext.decode(response.responseText);


accordian.add({


titleata.id


items: [

{


layout: {

type: 'hbox',

pack : 'center'

},

items:[{


initComponent : function(){

debugger;

var me = this;

var tpainStore = Ext.create('TPAIN.store.MyStore');

Ext.apply(me,{

store: tpainStore

});

me.callParent(arguments);

},


xtype: 'grid',

id : 'tod'+index,

alias: 'widget.tod'+index,

title: 'Product',

height : 400,

width : 420,

stripeRows : true,

columnLines: true,

//store:

margin : '3 3 3 3',

columns: [

{header: 'Product', dataIndex: 'product', flex: 1,sortable:true,hideable:false}

]


}


In my initComponent i am trying to instatiate store each time and it doesnt work ,

When i run the app i get error : Uncaught TypeError: Cannot read property 'items' of undefined


If i remove the initComponent function it works fine.


Any idea how i can do this?

Any help will be appreciated


Thanks

Jay






multiple instances of store in controller