ExtJS – how to add data to store and filter in combobox

  Kiến thức lập trình

I added combobox to my application:

  getParticipantsStore() {
      return Ext.create('Ext.data.Store', {
          fields: ['marketName'],
          data: [], // Początkowo puste, dane zostaną załadowane później

const store = this.getStore();

  xtype: 'combobox',
  fieldLabel: 'Filter by Market',
  store: store,
  displayField: 'marketName',
  valueField: 'marketName',
  queryMode: 'local',
  multiSelect: true,
  listeners: {
    select: this.onMarketSelect,
    scope: this,


I would like to have a list of all marketName in this combobox and filter by the value entered. Each value selected I would like to save i.e. in combobox I can select several values.

However, I can’t load the data into the store at all, much less filter by it.

I download the data in such a way (data in the form:

data: {
    data: Array[Array(array containing cells one by one)],
    header: Array[Object]

  loadMarketData(store) {
    let dataProvider = this.getDataProvider()

    if (dataProvider) {
    } else {
      dataProvider = createDataProvider()
        command: 'GetData',
        tableName: 'market',
        /** @param {Message} message */
        message => {
          if (Array.isArray(message.data.data)) {
            const marketNames = message.data.data.map(item => ({
              marketName: item[3],
          } else {
            Ext.Msg.alert('Error', 'Failed to load data.');


As you can see I am trying to load the data into the store by:
but nothing is displayed in my combobox

How to load data into store? How do I add a function that will return the text by which it filters and run a function that will ask for the data and update the store?

Thank you.