PDA

View Full Version : Sencha fiddle errors when running application



florinmarinescu
24 Apr 2017, 5:26 AM
Hello,

I have the following fiddle: https://fiddle.sencha.com/#fiddle/1ucp&view/editor. When pressing run, in the dev console the following errors appear (see the attached image). Note that the behaviour is intermitent: sometimes the application works and sometimes it doesnt. Why I'm receiving this errors and how to correct them?


Edit(errors in the dev console):


ext-modern-all-debug.js:1283
GET https://fiddle.sencha.com/local/14930400840963036547/Ext/grid/Panel.js?_dc=1493040087521
[Ext.Loader] Some requested files failed to load.


ext-modern-all-debug.js:1283
GET https://fiddle.sencha.com/local/14930400840963036547/Ext/toolbar/Toolbar.js?_dc=1493040087824
[Ext.Loader] Some requested files failed to load.

Thank you,
Florin

mitchellsimoens
25 Apr 2017, 3:59 AM
Your fiddle is marked to run with 6.2.1 Modern Triton, the modern toolkit does not have an Ext.grid.Panel (it's Ext.grid.Grid) or an Ext.toolbar.Toolbar (it's Ext.Toolbar).

florinmarinescu
25 Apr 2017, 5:20 AM
Thank you. Now I understood better how to use the fiddel.

mohammedsardar
25 Apr 2017, 5:55 AM
How do you find this ? A novice fiddle and to latest version fiddle how can troubleshoot this kind of situation ? Any ideas ?

mitchellsimoens
25 Apr 2017, 5:59 AM
The way I debugged it is I saw the errors and looked at what framework you were running. Once I saw it was modern toolkit, I knew instantly that modern doesn't have those classes. I guess it's just knowing what you are using and what that has.

I assume you are new to Ext JS and the two toolkits. Fiddle isn't aimed to be a full development editor/IDE just like other fiddle sites are not so don't expect it to have tons of tools to point out what you are doing wrong. Ask here in the forums and someone will hopefully help point out what's going on if you are relying on fiddle.

mohammedsardar
25 Apr 2017, 6:31 AM
This fiddle shows an error. How can we trace please ? The error frequently raising is it because of version issue ?

https://fiddle.sencha.com/#view/editor&fiddle/1uis

56214

Why all the errors pointing out ext-all-debug.js ? Give me a help please ? This error raising only if I use new version but old version no panel/viewport. Thanks

mitchellsimoens
25 Apr 2017, 6:33 AM
This is due to this code:


Ext.application({
name: 'School',
mainView: 'Assets.view.Viewport'
});

Two things:

App name is School but you are loading Assets, where are you telling Ext JS where Assets namespace resolves to?
You will need to add Assets.view.Viewport to the requries array in Ext.application so that Ext JS will attept to load that class. The mainView config does not require the class.

mohammedsardar
25 Apr 2017, 6:45 AM
1. But when we look at the fiddle Assets is the folder at the top right ? Then how can we leave that and mention other folders ? Initially I had it as School only then changed in order to test whether Assets may be considered and got the same.

2. I have corrected to add requires [] array as below. But Assets is root folder and view comes under Assets right ?

Ext.application({
name: 'School',
requires: [
'Assets.view.Viewport'],
});


I have changed to 'School.view.Viewport' to get correct myself but we get keep running window.

mitchellsimoens
25 Apr 2017, 6:47 AM
Fiddle doesn't inspect your source like Sencha Cmd does since Cmd is a command line tool, it's not available to a web app. Therefore, you have to tell Ext JS about it.

richardvd
26 Apr 2017, 4:55 AM
Your view classes were in the wrong directory level (/view instead of /app/view). Fixed Fiddle: https://fiddle.sencha.com/#view/editor&fiddle/1ulo

I can recommend these books:

Sencha Ext JS 6 Bootcamp in a Book: Classic Toolkit Edition by Steve Drucker (https://www.sencha.com/forum/member.php?96921-sdruckerfig): https://www.amazon.com/Sencha-Ext-JS-Bootcamp-Book/dp/1539406660

Ext JS 6: Getting Started by Stuart Ashworth (https://www.sencha.com/forum/member.php?62211-StuartAshworth): http://www.extjs6gettingstarted.com

mitchellsimoens
26 Apr 2017, 4:59 AM
A quick note to add to @richardvd's answer, yes your files need to reside in the app directory. This is because of Ext.app.Application's appFolder (http://docs.sencha.com/extjs/6.2.1/classic/Ext.app.Application.html#cfg-appFolder) config, by default it's set to 'app' which means the name of your app should resolve too that app directory.

mohammedsardar
26 Apr 2017, 7:25 AM
Thank you. I hope this will be very helpful along with if you can show me some video tutorials please ? Thanks

mohammedsardar
26 Apr 2017, 7:31 AM
Thanks. I hope this will really helps me. Would happy if you can show me some beginner level video tutorials too. Thanks a lot. I browsed over net but did not get an complete tutorials for Ext Js but only bits and pieces those were not recent versions. Please show me a light. Thanks again for your time.

mohammedsardar
26 Apr 2017, 7:33 AM
Hi Thanks Will review the books.

mohammedsardar
26 Apr 2017, 9:20 AM
I can't offer this much. Could you suggest me any other book please ? Thanks.