ExtJs4 Download Bar from URL

In ExtJs 3x, this code

Ext.getCmp('specific_panel_id').load({ url:'url_containing_scripts.htm', scripts:true, params:{ something:else } }); 

works to load content from a URL into a specific panel ...

However, it does not work in ExtJs 4.x.

+2
source share
3 answers

This also works:

 Ext.define('EI.view.Viewport',{ extend: 'Ext.container.Viewport', alias: 'widget.principal', layout: { type: 'vbox', align: 'center', pack: 'center' }, items:[ { xtype: 'panel', title: 'Mi Documentacion', width: 800, height: 600, border: false, autoScroll: true, loader: { autoLoad:true, url :'http://localhost/docs/' } } ] }); 
+1
source

The loading method has disappeared from Ext.panel.Panel in ExtJs4. As a workaround, you can try loading the contents of your panel using regular Ext.Ajax.request and installing them as elements in your panel.

Example:

 var itemsConfig; Ext.Ajax.request({ url : 'url_containing_scripts.htm', callback : function(options, success, response) { itemsConfig = Ext.decode(response.text); } }); Ext.getCmp('specific_panel_id').add(itemsConfig); 

Where url_containing_scripts.htm should have the necessary elements in your panel in JSON format.

In the same way, you can load the entire panel with all the necessary configuration settings.

0
source

Solved it with the following code:

 dynamicPanel = new Ext.Component({ loader: { url: 'url_containing_scripts.htm', renderer: 'html', autoLoad: true, scripts: true } }); 
Ext.getCmp('specific_panel_id').add(dynamicPanel);
code>
0
source

Source: https://habr.com/ru/post/952010/


All Articles