javascript - How to bind ViewModel Store to View? -


i'm pretty new ext js , trying embed multiselect inside panel.

the viewmodel has stores property can see here:

ext.define('test.view.controls.search.searchfiltermodel', {     extend: 'ext.app.viewmodel',     alias: 'viewmodel.filter',     data: {       title: ''     },     stores: {       test: {           fields: [ 'id', 'name' ],           proxy: {               type: 'ajax',               url: 'api/test',               reader: 'array'           },           autoload: true       }     } }); 

i bind in view this:

viewmodel: {   type: 'filter' },   layout: 'fit', border: 1, plain: true, scrollable: 'y', layout: 'fit',   bind: {   title: '{title}', },   items: {   xtype: 'multiselect',   scrollable: false,   allowblank: true,   ddreorder: true,   bind: {     store: '{test}'   },   valuefield: 'id',   displayfield: 'name' } 

in case, store ends null though , no data loaded widget. instead of binding store though, if hardcode in view, works.

anyone see issue is?

you can pass empty object store additionally binding store, way initcomponent work, example:

{     xtype: 'multiselect',     fieldlabel: 'multiselect',     store: {},     bind: {         store: '{test}'     },     valuefield: 'id',     displayfield: 'name' } 

working example: https://fiddle.sencha.com/#fiddle/ur8


Comments

  1. It is very nice to read your site, thank you very much for your work, it’s great!

    PHP MySQL MongoDB HTML Javascript NodeJS ExpressJS

    ReplyDelete
  2. Hey, I enjoyed this blog, where you talk about the growth of freelancers in the WordPress development field. I also know one of the great freelancing platforms for WordPress developers is Eiliana.com. Take a look at the freelancing platform too. It is a new yet great platform for technical experts.

    ReplyDelete

Post a Comment

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -