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

前端 未结 5 1252
陌清茗
陌清茗 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:26

    In my case (using ux/DataTip.js), with ext-4.2.1.883 and sencha cmd 4.0.2.67, I was able to use Ext.ux classes with the provided solution, using:

    Ext.Loader.setPath('Ext.ux', 'extjs/examples/ux');
    

    But the sencha app refresh complains, with:

    [ERR] C2008: Requirement had no matching files (Ext.ux.DataTip)

    Coping/linking extjs/examples/ux to extjs/src/ux solve my problem. The application works and sencha cmd is also able to keep track of things. With this copy/link operation, there is no need to use Ext.Loader.setPath. Just use the class in the requires:

    Ext.define('Demo.Application', {
    name : 'Demo',
    requires : [ (...), 'Ext.ux.DataTip'],
    

提交回复
热议问题