0
我想使用“ux”文件夹中提供的Ext.ux.TabReorderer插件,但无法使其在命名空间中工作。Extjs命名空间和TabReorderer
当我通常这样做(没有定义名称空间),它工作得很好。 (如下所示)
var tabPanel = Ext.create('Ext.tab.Panel', {
renderTo: Ext.Element.get('tabs1'),
bodyStyle: 'padding: 5px',
plugins: Ext.create('Ext.ux.TabReorderer'),
items: [{
xtype: 'panel',
title: 'Tab 1',
html : 'Test 1',
closable: true
}, {
xtype: 'panel',
title: 'Tab 2',
html : 'Test 2',
closable: true
},{
xtype: 'panel',
title: 'Tab 3',
html : 'Test 3',
closable: true
},{
xtype: 'panel',
title: 'Tab 4',
html : 'Test 4',
closable: true
}]
});
但是,当我把它放在命名空间中是行不通的。
Ext.define('MyApp.Layout.CenterTabs', { extend: 'Ext.tab.Panel',
bodyStyle: 'padding: 5px',
plugins: Ext.create('Ext.ux.TabReorderer'),
items: [{
xtype: 'panel',
title: 'Tab 1',
html : 'Test 1',
closable: true
}, {
xtype: 'panel',
title: 'Tab 2',
html : 'Test 2',
closable: true
},{
xtype: 'panel',
title: 'Tab 3',
html : 'Test 3',
closable: true
},{
xtype: 'panel',
title: 'Tab 4',
html : 'Test 4',
closable: true
}]
});
在Chrome中我得到的错误:
XMLHttpRequest cannot load [OMMITTED THIS PART]/extjs-4.1.0/examples/ux/TabReorderer.js?_dc=1338489585629. Cross origin requests are only supported for HTTP.
这是为什么,我该如何解决?