PDA

View Full Version : Dynamically adding tab with different store parameters



maodarin
4 Aug 2020, 5:36 PM
I create a tab by copying a sample tab.



createTab: function (rec, cfg) {
var tabpanel= Ext.getCmp('robeca-view-main-Main');

var myPanel = Ext.create({
xtype: 'TicketDetail',
});

cfg.itemId = id;
cfg.items = myPanel;
tabpanel.add(cfg);
}






my grid.Panel contains storage "RequestHistory"





Ext.define('robeca.view.main.details.RequestHistory', {
extend: 'Ext.grid.Panel',
alias: 'widget.TicketDetail',

store: {
type: 'RequestHistory'
},
columns: [{
text: 'time',
dataIndex: 'dt'
}]
});






When creating a new tab, I must pass a new parameter to the store RequestHistory, suppose ID. How can I use one store, multiple times with different parameters and with different tabs?

I cannot load all the data into the store and use the view, it is a lot of data. I need to upload data to the store every time using a this ID.

if I use one store for all grids - information will be updated in all grids at once when the store is reload with a new ID parameter...