Errors After Upgrading from EXTJS 4.2 to EXTJS 6.x - extjs

So far, I've done the upgrade in two ways:
1) I set up a fresh sencha app generate [appName] and transferred the 4.2 files and directories to 6.x. After setting them up, an error occurs when doing a sencha app build:
The following error occurred while executing this line:
/var/www/html/backoffice-test/EcommBackoffice/.sencha/app/build-impl.xml:381: The following error occurred while executing this line:
/var/www/html/backoffice-test/EcommBackoffice/.sencha/app/init-impl.xml:382: com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Ext.ux.grid.filters.Filters
rareyes#MAKDL-RAREYES:/var/www/html/backoffice-test/EcommBackoffice$
Along with this, upon loading the app, the console error is giving out these lines:
http://localhost:1841/EcommBackoffice/Overrides/view/Table.js?_dc=1452581765612`
http://localhost:1841/EcommBackoffice/Overrides/selection/Model.js?_dc=1452581765612`
[E] [Ext.Loader] Some requested files failed to load.
[E] [Loader] The following classes failed to load:
[E] [Loader] Overrides.view.Table from Overrides/view/Table.js
[E] [Loader] Overrides.selection.Model from Overrides/selection/Model.js
[E] [Loader] EcommBackoffice.Application from app/Application.js
2) Being stucked on the first one, my second approach was to simply do a sencha app upgrade -ext on the existing application. It successfully updated except when doing a sencha app build it gives out a similar error such as:
The following error occurred while executing this line:
/var/www/html/backoffice-2.0/src/main/webapp/.sencha/app/build-impl.xml:381: The following error occurred while executing this line:
/var/www/html/backoffice-2.0/src/main/webapp/.sencha/app/init-impl.xml:382: com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Ext.ux.grid.FiltersFeature
and a short console error of: Uncaught ReferenceError: Ext is not defined
This occurs when I edit index.html and replace x-compile snippet:
<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<link rel="stylesheet" href="bootstrap.css">
<script src="ext/ext-all-debug-w-comments.js"></script>
<script src="bootstrap.js"></script>
<!-- </x-bootstrap> -->
<script src="app.js"></script>
<!-- </x-compile> -->
to this:
<script id="microloader" data-app="a32fd6d2-db0c-4c4b-a6a2-4185b3ee3fd4" type="text/javascript" src="bootstrap.js"></script>
Prior to editing index.html, a different error is being thrown with x-compile:
/.sencha/app/init-impl.xml:382: com.sencha.exceptions.ExBuild: Mixed-Mode x-compile and microload markup is currently unsupported
This is the reason why I opted for the supported Microloader provided by 6.x
I am quite on a lost here. ExtJS apparently has no proper Sencha guide to upgrade directly from 4.x to 6.x. It only does a one step higher upgrade such as 4.x to 5.x, and 5.x to 6.x. Even then, the guide for these are not very clear and IMHO, lacks documentation.
Anyone who can point where the problem is with the errors I provided?

Well, the Cmd error message says it loud and clear:
Unknown definition for dependency : Ext.ux.grid.filters.Filters
This means that ExtJS6 does not provide Ext.ux.grid.filter.Filters, which is required somewhere in your application.
As the Ext documentation states, everything from Ext.ux namespace is not upgrade-safe, because it is user-provided content that Sencha has found useful and added to the Ext zip file. Normally, you would just search the internet for available ExtJS 6.0.x implementations of the ux features that are missing from the official zip file; or write them yourself.
But for your special case, I believe that they moved gridfilters from ux into the official branch in ExtJS 4.2.x, then removed the alias in ExtJS 5, and finally, in ExtJS 6, they replaced the feature with a plugin.
So please have a look at Ext.grid.filters.Filters, I believe it does what you need, but you would have to rewrite parts of your code to make use of it. (change the require, move the reference from features to plugins, possibly account for other changes.)
I think that the second error message ("[E] [Ext.Loader] Some requested files failed to load.") means the same as the first one, and I would expect something like requires:['Ext.ux.grid.filters.Filters'] in Overrides/view/Table.js. (Overrides.selection.Model isn't loaded because it requires Overrides.view.Table, and EcommBackoffice.Application isn't loaded because it references Overrides.selection.Model)

Related

Sencha Architect 3.5 / ExtJS 6.0.X - Cannot import Charts - Build Error

I'm currently using Sencha Architect 3.5 and ExtJS 6.0.X, and I am having trouble importing the Charts library/js file needed.
I have a panel with a ColumnChart/CartesianChart on it, I've also set the Store and column values in anticipation of the actual data that I'll be getting from my database.
However, after refreshing and loading my Web App, I got the following error:
GET http://localhost/MyApp/ext/classic/classic/src/chart/series/Bar.js net:: ERR_ABORTED 404 (Not Found)
GET http://localhost/MyApp/ext/classic/classic/src/chart/axis/Category.js net:: ERR_ABORTED 404 (Not Found)
GET http://localhost/MyApp/ext/classic/classic/src/chart/series/Numeric.js net:: ERR_ABORTED 404 (Not Found)
GET http://localhost/MyApp/ext/classic/classic/src/chart/CartesianChart.js net:: ERR_ABORTED 404 (Not Found)
Here's what I've done so far:
I've added in "ext-charts" to my app.json file in the project folder root, under the requires segment. However, did this not work as I'm working on ExtJS 6.0.X, not ExtJS5.
I've also tried adding in "sencha-charts", "charts", instead of "ext-charts", but to no avail, I still got the same error.
Of course just adding in those lines in the app.json file was insufficient, as this document from Sencha shows, I also had to run sencha app build on my project's root folder using terminal.
I opened a terminal window and then navigated to my project's root folder and executed sencha app build. However, I then encountered this error:
Sencha Cmd v6.1.2.15
[INF] Processing Build Descriptor : default
[WRN] Failed to resolve package theme-crisp64796bdf-bf6a-417b-b82d-1b8f7f35f246
[ERR] Cannot satisfy requirements for "core" !
[ERR] The following versions cannot be satisfied:
[ERR] classic: core (No matches!)
[ERR] charts: core (No matches!)
[ERR] Cannot resolve package requirements
I also tried to do it without Sencha Cmd, by adding in:
<script type="text/javascript" src="ext/build/packages/charts/classic/charts.js"></script>
<link rel="stylesheet" type="text/css" href="ext/build/packages/charts/classic/classic/resources/charts-all.css">
To my index.html file, making sure to uncheck "Overwrite index.html on save" in SenchaArchitect, while keeping the "charts" line in the "requires" part of app.json. However, that too did not help.
Not sure how I'm supposed to proceed from here.
Here are the versions of the important software:
Operating System: MacOS 10.13.6 (High Sierra)
SenchaArchitect Version: 3.5.1.348
SenchaArchitect Channel: 3.5-stable
SenchaArchitect Platform: 0.36.7
Sencha CMD: 6.1.2.15
Framework: ExtJS 6.0.X
Ruby and JRE are both installed and are detected by SenchaArchitect

Use ReactJS in ASP.Net Core without React.ASPNet library

In one of my asp.net core project, I want to use ReactJS. Can anyone suggest me that how to implemen ReactJS without using ReactJS.net library (https://reactjs.net/)?
I have tried but getting an error in JSX file. I have already installed JavaScriptEngineSwitcher.
My App.jsx file is as given below, only a single statement
ReactDOM.render(test,
document.getElementById('divNew'));
I took the reference of App.jsx file in About.cshtml , after adding react and react-dom references. But getting the following error
Uncaught SyntaxError: Unexpected token <
EDIT :
I was able to solve my problem by adding Babel , a java script compiler.
I added the below given lines in About.cshtml, where I want to render UI using ReactJS. Before this I also added the reference of React and React-DOM.
<script src="https://unpkg.com/babel-standalone#6/babel.min.js"></script>
<script type="text/babel" src="~/ClientApp/App.jsx">
</script>
This solves my problem and can be helpful for others. However, in developer tool I am getting a warning
"You are using the in-browser Babel transformer. Be sure to precompile your scripts for production"
To handle this warning, we can use any option defined on the below given link
https://babeljs.io/en/setup/
Hope this will help others :-)

Unable to load ngCookies into Web Application

I am trying to implement a 'remember me' option on my login page and have ventured down the path of using ngCookies to store a local cookie to handle this. However, in trying to follow the instructions from angular documentation I am unable to get the module working in my Web Application.
I am using AngularJS version 1.4.8 and have made sure my angular-cookies.min.js is running the exact same version. I have made sure to add my <link> tags in the correct order:
<script src="../vendor/jquery/dist/jquery.min.js"></script>
<script src="../vendor/angularjs/angular.min.js"></script>
<script src="../vendor/angularjs/angular-cookies.min.js"></script>
However, when I try to load the module into my application:
var EdgeApp = angular.module('EdgeApp', [
'ngCookies',
'ngAnimate',
....
])
I get an $injector:modulerr error:
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.8/$injector/modulerr?p0=EdgeApp&p1=Error%3A…2Fdrake-monitor%2FRestApi%2Fvendor%2Fangularjs%2Fangular.min.js%3A19%3A463)
All other modules and dependencies load correctly and work fine.
Based on the advice from #WonderGrub, I stripped my project back to the bear basics and worked from the ground up.
To start with, I installed all of my external modules correctly using Bower (something I wasn't doing before), then I added one module at a time to see if I had any conflicts.
I also reverted back to using .js files instead of .min.js files for my development to help me identify errors more accurately.
I'm unsure what the actual cause of my issue was, but going through the procedures above and the advice from my initial post has worked for me without errors.

Error after downloading HotTowel.Angular

I created an empty web solution, added an empty web application, used following NuGet command to download HotTowel.Angular template,
Install-Package HotTowel.Angular -pre
Executed the project and as soon as I run my web application it shows splash screen then, I get following error:-
{{VM.BUSYMESSAGE}}
Any idea why is that ?
I get the same error after updating to jQuery 2.1.3. I do not get this error with the default template issued version of 2.1.1.
UPDATE: It turns out I forgot to change the version in the script reference to jQuery on the index.html page to match the library. So check that out on your end and you should have your solution.
I have same problem. I tried both installing it via nuget package and package manager console. No Luck. Showing {{ VM.BUSYMESSAGE }} on screen. Error is showing $ is undefined. Looks like it is problem related to jQuery.
Unhandled exception at line 7, column 38 in scripts/bootstrap.js
0x800a139e - JavaScript runtime error: Bootstrap's JavaScript requires jQuery
index.html page contain:
<script src="scripts/jquery-2.1.1.js"></script>
Check your jQuery version and update to
<script src="scripts/jquery-2.1.N.js"></script>
//In my case
<script src="scripts/jquery-2.1.4.js"></script>

ExtJS 4.2 - Ext.ux.Printer library/class does not work

Good day. Sorry but I've stumbled upon a problem that I can't seem to figure out for the past couple of hours. I downloaded this printing class to be able to print a Form that I have in my web application. I copied the Ext.ux.Printer folder in my scripts folder inside resources. The file path looks like: resources/scripts/Ext.ux.Printer and the resources folder is on the same level as the app folder.
My Loader looks like:
Ext.Loader.setConfig({
enabled: true,
paths: {
'Ext.ux.Printer': 'resources/scripts/Ext.ux.Printer/Printer'
}
});
And the Application looks like:
Ext.application({
requires: [
'Ext.Loader',
'Ext.layout.container.Absolute',
'resources.scripts.Notification',
'Ext.layout.container.Column',
'Ext.ux.Printer.Printer'
], //models, views, controllers, follow after
and I try to use it in my code as such:
Ext.ux.Printer.print(form);
However, I am given an Uncaught TypeError: Cannot read property 'Printer' of undefined whenever I try to execute the line of code above.
Can anyone help me? I'm a beginner in ExtJS4 and I'm just trying to follow examples I see around the internet - it is possible that I tried to appropriate my code incorrectly with something I saw online.
Any help is very much appreciated, thank you.
UPDATE 1
Upon discussion with Guilherme Lopes below we did the following steps:
Import the js files by adding it as a js resource in Sencha Architect. Make sure that the file path is correct.
Check the includeAfterAppJS checkbox. Due to a bug in Architect, sometimes the JS Files are added in before the ExtJS.
Open index.htmluse ext-all.js instead of ext-dev.js. Note that Sencha Architect overwrites/resets this file every time you save your project. A quick fix is to go to project settings and uncheck updating index.html.
Try Ext.ux.Print.print(form);
By the developer instructions, you should import the script files using your main html document, the same way you do with ExtJS classes (if you are not using the bootstrap).
These lines should be added after you import the ExtJS library:
<script type="text/javascript" src="Printer.js"></script>
<script type="text/javascript" src="renderers/Base.js"></script>
The library currently comes with renderers for Ext.grid.GridPanel, and Ext.tree.ColumnTree.
These can be included as required:
<script type="text/javascript" src="renderers/GridPanel.js"></script>
<script type="text/javascript" src="renderers/ColumnTree.js"></script>
And your calls to Ext.ux.Printer should start working.
If you are using Architect, add your external JS files clicking on: + => Resources => JS Resource
And then change the URL to the path you need (do this for every file you wish to add)
* I would just uncheck the x-compile and x-bootstrap

Resources