0
votes

I've tab panel with two tabs. I want to add a new row to a grid panel in the second tab. And I want to do it from the first tab. But I can't get it to work. Is it not possible to add a row to a grid, which is not visible?

There is no errors and my function works if the grid is visible.

1
I have faced something like that and i could not find any solution. So i save in json the data i wanted to add and on tabchange i added the data. If you find the solution please post it. I will help a lot.kostas ch.
What have you tried? Can you post some code? Otherwise answers will be based on a lot of assumptionsSW4

1 Answers

1
votes

With ExtJS it does not matter what tab you are currently viewing. You can get a component and load data into it from anywhere.

Give the grid an ID and then you can get it using Ext.getCmp('id');

An example would be as follows:

Ext.create('MySecondPageGrid',{
   extends:'grid',
   id:'secondpagegrid',
   store: Ext.create('MyStore'),
   ...
});

And wherever you are handling your first page tab actions:

 var grid = Ext.getCmp('secondpagegrid'),
     store = grid.getStore();

    store.load(yourData,false);