0

Hello i am want output in grid data from two store (store:'book' and store:'price') i am do this:

Ext.define('TPL.book', {
title: 'Price for Books',
store: 'Book',
header: false,
stripeRows: true,
   constructor: function (config) {
    this.initConfig(config);
    this.callParent(arguments);
},
initComponent: function() {

    this.columns = [
        {header: 'Id', dataIndex: 'id', flex: 1, hidden: true},
        {header: 'Name', dataIndex: 'name', width: 600, hidden: false},
        {header: 'Price', dataIndex: '???', width: 100, hidden: false},
    ];
    this.callParent(arguments);
}

});

I am want in column 'Price' output data from store 'Price' where id from store 'Book' equal id from store 'Price'

user3045654
  • 1,634
  • 2
  • 12
  • 21

1 Answers1

1

You would just do a store filter on your click event or load event. Good example here: How to filter a store with multiple values at once?

If you have it in two stores and need to combine it down to one store you could do a Ext.each(array, function(value) {}); and then just push the matched pairs into a new store. I would use the filters and give them filter IDs though and you could then remove filters pretty easily.

Community
  • 1
  • 1
JesseRules
  • 723
  • 5
  • 17