How do you include a UX class in the MVC pattern?

前端 未结 5 1255
陌清茗
陌清茗 2020-12-30 09:01

Before the MVC pattern I would include UX classes simply by including this at the top of the JS, before Ext.onReady:

Ext.Loader.setConfig({enabl         


        
5条回答
  •  长情又很酷
    2020-12-30 09:16

    Extjs 6, using the MVVC and the sencha cmd. I used the sencha generate app to start an app. I coded to the point where I wanted to use the ItemSelector, modified the app.json to require a block added in the ux:

    "requires": [
      "font-awesome",
      "ux"
    ],
    

    In my controller code where I wanted to create the ItemSelector widget:

    requires: [
        'Ext.ux.form.MultiSelect',
        'Ext.ux.form.ItemSelector'
    ],
    

    and the appropriate code to create the ItemSelector. One issue I had is, that it wants a real data store with a model and I could not use mocked up data.

    Then I did a sencha app build

提交回复
热议问题