JavaScript bind a store to a list filter in extjs 5

I am using extjs 5 on web app using sencha CMD layout (mvvm) and would like to bind a store (for labels) to filter list in my view grid the viewModel store definition is:

 stores: {
    labelContacts: {
        model: 'myapp.model.label.Contact'
        , autoLoad: true
    } // end contact store
 } // end stores

and my list filter code in view grid

filter: {
                type: 'list',
                bind: {store: '{labelContacts}'}
                labelField: 'DisplayValue',
                valueField: 'keyId'
        }

the filter works but it doesn't show data from the bound store but creates it's own from the grid's store

am I missing some thing?

Answer:1

Pass these property in filter and try this:

        type: 'list',
        store: store, // your store
        labelField: 'DisplayValue', // Your displayValue
        valueField: 'keyId', // Key Id on which you want to add filter          
Answer:2

I found a workaround to get the bound store but I am not satisfied by the solution as it's not really an elegant one, and would be glad to hear any suggestions my solution was changing the store to:

filter: {
    type: 'list',
    store:new myapp.view.main.MainModel().getStore('labelContacts'),
    labelField: 'label',
    valueField: 'id'
}
Answer:3

I am trying to mount/unmout a Pixi stage with React (I don't want to use react-pixi yet) I have an error when I re-mount the component: Uncaught Error: Resource with name "cupCake.png" already ...

I am trying to mount/unmout a Pixi stage with React (I don't want to use react-pixi yet) I have an error when I re-mount the component: Uncaught Error: Resource with name "cupCake.png" already ...

I want to understand the best way to improve the performance of jQuery code. Actually, I know how to cache the jQuery selectors to not touch the DOM multiple times as follow: The worst way $('....

I want to understand the best way to improve the performance of jQuery code. Actually, I know how to cache the jQuery selectors to not touch the DOM multiple times as follow: The worst way $('....

I'm trying to test protractor on a vanilla.js app and when I run protractor basicConf.js I am getting below error : This webpage is not available ERR_CONNECTION_REFUSED This is my test: describe(...

I'm trying to test protractor on a vanilla.js app and when I run protractor basicConf.js I am getting below error : This webpage is not available ERR_CONNECTION_REFUSED This is my test: describe(...

  1. run protractor config file
  2. run protractor config
  3. protractor run configuration
  4. npm run protractor config file
  5. npm run protractor config

I have created a Simon Game here on Codepen: http://codepen.io/nalexiou/pen/rOaQOK On the desktop, the audio/sound is playing fine. However, when I visit the site using my iPhone's Safari, the sound ...

I have created a Simon Game here on Codepen: http://codepen.io/nalexiou/pen/rOaQOK On the desktop, the audio/sound is playing fine. However, when I visit the site using my iPhone's Safari, the sound ...