I'm trying to set up extjs framework and getting and error 'ext' is not present in the current workspace
root#samuel-pc:~/Documents/code/test# sencha app install --framework=/home/samuel/Downloads/ext-6.5.0
Sencha Cmd v6.5.0.180
[INF] Using existing workspace at /home/samuel/Documents/code/test
[WRN] Workspace may not be initialized properly, consider including the --frameworks switch.
[ERR] Framework 'ext' is not present in the current workspace.
Check your workspace.json file; there the ext property maybe missed maybe because of sencha workspace init command; add the ext property as follows according to your ExtJS version.
"frameworks": {
"ext": {
"path":"ext",
"version":"6.2.1.167"
}
}
Related
What is the best practice to use overrides in extjs 6.2 application. How to make all files inside override folder require by default. In 4.2 we use to set it overrides path in sencha.config and in application requires section we used to mention overrides.*.
I tried the same with 6.2 but i failed to configure. When i mention override option one by one in application requires section it works like 'overrides.Ajax' but when try to make entire override like 'overrides.*' it does not work.
After creating override we need to build or refresh the application using sencha command. When i did sencha refresh all the override files are included by default.
While executing sencha app watch We are getting the following exception:
[ERR] Failed to resolve dependency Ext.ux.LiveSearchGridPanel for file myapp.vie
w.staticData.StaticDataGrid
[ERR]
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Ext.
ux.LiveSearchGridPanel
[ERR] at sun.reflect.Native
[ERR] MethodAccessorImpl.invoke(Unknown Source)
We have tried to hardcode the path where this extension is located via the paths attribute in Application configuration as is suggested in the following stack overflow answers: How do you include a UX class in the MVC pattern? but nothing worked. Perhaps we have misunderstood how to configure the path in the loader as it is not something we have needed in the past.
Note: we are using the latest Sencha Cmd version v6.0.2.14 and the latest ExtJS v6.0.1
Any ideas are welcome
The Ext.ux namespace is being moved from the examples/ux/ directory in Ext JS 4.x to the ux package in Ext JS 6.x. Therefore, in your app.json you need to require the ux package so that Cmd will include it, you'll need to use sencha app watch, sencha app refresh or sencha app build to regenerate the bootstrap data that hold information like file location for classes. Then you should be able to require/extend Ext.ux.LiveSearchGridPanel.
Inside app.json you should change this:
"requires": [
"font-awesome"
],
into this:
"requires": [
"font-awesome",
"ux"
],
According to this link this class is for ExtJS 4.2.2 and therefore is not supported in your ExtJS version.
When developing I want to use a a minified .js file of Ext JS 5.1 like they do on Sencha Fiddle. It looks like you can use the cdn link from Sencha but when I use this in the index file it fails.
Is there something I need to be doing in the bootstrap.js file to make it use just a link instead of the Ext Js 5 root folder? I want to use the same link for multiple apps hosted on a server for an enterprise situation.
Also, the Chrome Dev Tools running super slow having to load each file. I want to use one minified file to make this useful again.
I'm not positive how you could use the cdn file referenced in the sencha fiddle website. Adding that link directly to the app while using the microloader would cause errors. The microloader in extjs5 automatically figures out which files to load in the framework.
However, you can achieve a similar goal of using a minified version of the extjs framework if you are using sencha cmd.
They detail how to setup your project to use the minified or developer copy of extjs5 instead of loading all the seperate files in this forum post
Here are the changes to make to your project documented to stack overflow in case that forum post is no longer available:
Step One
make sure you are using a version of sencha cmd greater than 5.0.2.
To determine your version of sencha cmd you can type the following in the command prompt:
sencha which
If you have an older version of sencha cmd you can download the latest copy here
Thanks to Niederee for this little advice, do a sencha app upgrade on your app to make sure it's tied to the latest sencha command build
sencha app upgrade
Step Two
Adjust your app.json manifest file to load the ext-all-rtl-debug.js . Add this file to the "js":[] array in the file:
"js": [
{
"path": "${ext.dir}/build/ext-all-rtl-debug.js" // new default for generated apps
},
{
"path": "app.js",
"bundle": true
}
],
You can also add sencha charts if they are required to get that minified build too:
{
"path": "${ext.dir}/packages/sencha-charts/build/sencha-charts-debug.js"
},
Optionally you can also adjust the cache preferences based on dev/production
Add this additionally to the app.json file:
"development": {
"loader": {
"cache": true
}
},
"production": {
"loader": {
"cache": "${build.timestamp}"
}
}
Step Three
In the command prompt run the following sencha command to refresh your application's bootstrap manifest.
sencha app refresh
I am initializing cordova in my app which was using touch2.3 and added barcodescanner.js file in app.json and build it successfully using sencha app build native.I loaded .apk file in my android and trying to run,when I hit scanner button it is raising an alert saying cordova/plugin/BarcodeScanner not found.I updated config.xml . How to add custom cordova plugins to new Sencha tocuh2.3?.Please help me on where I was going wrong.Any help would be appreciated.Thank you
Download the repo using GIT or just a ZIP from Github.
Add the plugin to your project (from the root of your project):
go to your cordova or phonegap folder run follwing cmd
cordova plugin add
then run beloows for check
cordova plugin ls
I tried following these instructions without success and let me be more specific:
created sencha 2.3 app called myscan
added Cordova (not Phonegap) with Sencha cordova init
cd to Cordova folder
added the plugin
cordova plugin add https://github.com/wildabeast/BarcodeScanner
5 build the app with sencha app build native
6 created a simple test
Ext.device.Scanner.scan(function(c) {
alert("We got a barcode\nResult: " + c.text + "\nFormat: " + c.format + "\nCancelled: " + c.cancelled)
}, function(c) {
alert("Scanning failed: " + c)
})
I was not surprised to see that Ext.device was not defined as all the example code I could find use the navigator object so I looked at the WildaBeast sample code and changed the call to
Cordova.plugins.barcodeScanner.scan ... Now everything is defined and I trace into the code and seems to make the call into IOS but nothing meaningful results and no callbacks are called.
Now Gigi are you using Sencha Cmd v4.0.1.45
after installed barcode scanner plugin use sencha plugin Ext.ux.mgd.device.Scanner
I have a workspace project that includes an ExtJS app, Touch app, and a set of files that are shared between the two projects set up like this
WorkspaceFolder
ExtJSAppFolder
TouchAppFolder
SharedCodeFolder
I have the SharedCodeFolder referenced in the bootstrap loader and the ExtJS/Touch applications load in the browser fine
bootstrap.js
Ext.Loader.addClassPathMappings({
"ExtJSApp": "app",
"Ext": "../ext/src",
"Ext.rtl.EventObjectImpl": "../ext/src/rtl/EventObject.js",
'SharedCode': '../SharedCodeFolder/'
});
but when I try to use Sencha Cmd to build, it's giving me this error
[ERR] failed to find meta class definition for name
ExtJSApp.store.SharedCode.store.StoreFile
How do I tell Sencha Cmd to not append the ExtJS app namespace to the name of the SharedCode file? It should be looking for
SharedCode.store.StoreFile
not
ExtJSApp.store.SharedCode.store.StoreFile
You can add the SharedCodeFolder path to your workspace.classpath in the WorkspaceFolder/.sencha/workspace/sencha.cfg file:
workspace.classpath=${workspace.dir}/SharedCodeFolder
See here for more info:
http://docs.sencha.com/ext-js/4-2/#!/guide/command_workspace-section-7