Domanda

I have planned to use the Ext.ux.panel.PDF extension https://github.com/SunboX/ext_ux_pdf_panel for my app but cannot make it to work inside my Sencha Architect 3.0. I have downloaded the files and put the js file in my project directory /ext/src/ux/panel/PDF.js. In the apllication I have put the require line on the top level under Application

Ext.application({

    requires: [
        'Ext.window.MessageBox',
        'Ext.ux.panel.PDF'
    ], ... 

But when I want to instantiate the pdf panel with the code from the example I keep getting this error:

Uncaught Error: The following classes are not declared even if their files have been loaded: 'Ext.ux.panel.PDF'. Please check the source code of their corresponding files for possible typos: 'ext/src/ux/panel/PDF.js 

Please advise.

EDIT: I have tried using a loader but the error is still present

Ext.Loader.setConfig({
    enabled: true,
    paths: {
        Ext: 'ext/src'
    }
});
È stato utile?

Soluzione

The error you get means, that the file ext/src/ux/panel/PDF.js does not contain valid javascript. I tested this extension, and I don't get that error.

It the file is empty, you will get this error only, if it contains invalid javascript, this should be the second error, while the first will complain about the syntax error. If the file is missing, you'll get another error.

Have a close look at the file, maybe it got corrupted while downloading or unzipping the extension. Or you edited it by error and introduced an error.

Altri suggerimenti

try to add below code on top of your Ext.application({ ~~~ source

Ext.Loader.setPath({
    'Ext.ux' : 'YOURPATH(ABSOLUTE OR RELATIVE)/ext/src/ux'
});
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top