2

The application does not include the UX. The entire extjs library is in - myexample/js/ext-6.2.0 I copied from myexample/js/ext-6.2.0/ packages the folder "ux" with all the contents into my application

test
|---app.js
|
|---app
|    |---controller
|    |---model
|    |---store
|    |---ux 
|    |---view
|---index.html

Then in app.js, before calling the application I connect 'ux':

Ext.Loader.setConfig({enabled:true});
Ext.Loader.setPath('Ext.ux', 'app/ux');
Ext.application({
....

I get the error:

[Ext.Loader] Synchronously loading 'widget.treepicker'; consider adding Ext.require('widget.treepicker') above Ext.onReady

Version: Ext JS 6.2.0.981 - JavaScript Library

What am I doing wrong? How to incldue UX? Thanks.

Ambasador
  • 365
  • 3
  • 14

2 Answers2

2

try adding this in the app.js file

requires:[
    'Ext.ux.your_file_name' //your_file_name inside the ux folder
]
1

In file "app.json" you should find "requires" config similar to this

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

"app.json" will be present in Extjs application folder, this folder will be the result of command :

sencha generate app -ext MyApp /path/to/my-app

This is where you import the package. So part of your code is making "ext" package to be not loaded. This is causing error related to "treepicker". Because "treepicker" is part of "extjs" package. Try including package this way. It should work.

Yeshwanth N
  • 570
  • 4
  • 15
  • where is the app.json file? – Ambasador Oct 19 '18 at 08:06
  • It'll be present in application folder of Extjs application. There would be a folder created when you run " sencha app generate ". It'll be present in that folder. – Yeshwanth N Oct 19 '18 at 08:43
  • When creating applications, I downloaded and decoupled extjs on the server, and then in my application's index.php, I include the necessary files from the extjs package. Do I understand correctly that I now need to install sencha cmd, and then generate a new application? – Ambasador Oct 19 '18 at 09:05
  • yes its good to access packages from application rather than direct, because application bootstrap will take care of lot of things including the problem which you are facing. – Yeshwanth N Oct 19 '18 at 09:09
  • But I don’t understand one thing, I’ve already created an application, what exactly do I need to do after installing sencha cmd – Ambasador Oct 19 '18 at 09:17
  • If application is created already then you should find "app.json" in application folder. – Yeshwanth N Oct 19 '18 at 09:20
  • I created the structure of my application manually: controller, model, store, view and files that are inside folders, as well as app.js and index.php – Ambasador Oct 19 '18 at 09:34
  • Then you can add "app.json" yourself. For its contents generate another dummy application using sencha cmd. – Yeshwanth N Oct 19 '18 at 09:39
  • It turns out that I can manually create the app.json file after I install sencha cmd on my server. If so, what kind of content and its location should it be? – Ambasador Oct 19 '18 at 10:02
  • That command which I showed will create the application folder. This will have "app.json" , you'll get the contents in this file. – Yeshwanth N Oct 19 '18 at 10:48
  • Thanks, I understood what to do – Ambasador Oct 19 '18 at 12:59
  • i dint find app.json in extjs 4.2.2 , how can i fix this issue in extjs 4.2.2? – Sparrow Jun 17 '20 at 08:50