2

I have an external html within a Panel in Extjs. But the scripts which are defined with script tags in my html are not loaded; thus therefore my html does not work properly.

var test = Ext.create('Ext.panel.Panel', {
            title : 'Example 1',
            width : 250,
            height : 250,
            frame : true,
            scripts: true,
            autoLoad : {
                url : './test.html'
            }
        })

Until now i have tried:

The first two load my script to the Extjs (i can see it in firebug) but still my html file can not access it.

Thus;

What are the (working) alternatieves to get it working?

Asqan
  • 4,319
  • 11
  • 61
  • 100

1 Answers1

1

The autoLoad config is deprecated. Use loader instead.

var test = Ext.create('Ext.panel.Panel', {
    title : 'Example 1',
    width : 250,
    height : 250,
    frame : true,
    loader: {
       url: './test.html',
       autoLoad: true,
       scripts: true
    }
});
Ruan Mendes
  • 90,375
  • 31
  • 153
  • 217
  • Correct! but please update that we also have to add: "render: 'html' to "loader" so that the scripts can be readed! Although it is an answer to my question, i think it is not the correct way of use. Because, in every opening of the page, scripts will be loaded again and again (Also does not work in Firefox 31 and Chrome 37). Is there another way to load the scripts in Extjs AND we will still be able to use them also in a external html file? – Asqan May 28 '15 at 11:28
  • @Asqan There is no `render` config. There is a [`renderer`](http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.ComponentLoader-cfg-renderer) which already defaults to `html`, so it should not be needed. As to your second problem, it's outside of the scope of the initial question, which has been answered. At StackOverflow we like each question to be about a single problem so that it can be most useful to others. – Ruan Mendes May 28 '15 at 12:49
  • Therefore i had already created another question for [that very related question](http://stackoverflow.com/questions/30506907/is-it-possible-to-use-scripts-of-extjs-in-external-html) you are welcome! – Asqan May 28 '15 at 13:11
  • No, i meant that i would like to see your answer also in that question. It was just a translation error. But anyway, thank you absolutely :) – Asqan May 28 '15 at 18:42