加载自定义类在ExtJs中不起作用
Loading of custom class not working in Ext Js
我正在尝试以下代码,但它不起作用。我可以在浏览器状态栏中看到,正在加载来自正确路径的正确javascript文件,但UI没有显示。相反,如果我将整个代码内联(在app.js中),那么一切都会如预期的那样工作。我使用Ext Js 4.1.1。
app.js
Ext.onReady(function () {
Ext.Loader.setConfig({
enabled: true,
paths: {
'company': './src/company'
}
});
var largeHomeButton = Ext.create('company.classes.ToolbarLargeButton', {
iconCls: 'home32'
});
var myToolbar = Ext.create('Ext.toolbar.Toolbar', {
items: [largeHomeButton]
});
var master = Ext.create('Ext.panel.Panel', {
layout: 'absolute',
x: 0, y: 0,
height: 100, width: 110,
border: 5,
lbar: [myToolbar]
});
Ext.create('Ext.Viewport', {
layout: 'anchor',
items: [master]
});
});
src/company/classes/ToolbarLargeButton.js
Ext.define('ToolbarLargeButton', {
extend: 'Ext.button.Button',
scale: 'large',
iconAlign: 'center'
});
我认为您应该在Ext.define
:中指定完整的类名
Ext.define('company.classes.ToolbarLargeButton', {
相关文章:
- electronic BrowserWindow的最小高度和宽度在hide()show()方法之后不起作用
- 监视函数从服务返回不起作用,但作用域函数起作用
- 幻灯片滚动javascript不起作用
- 简单的javascript在Shopify中不起作用
- 加载自定义类在ExtJs中不起作用
- ExtJs 5.0:forEach on Array of Objects在IE8中不起作用
- ExtJS:无限滚动不起作用
- Netbeans 8.0.2 extjs 项目自动完成不起作用
- ExtJS 窗口不起作用
- ExtJS 事件委派不起作用
- ExtJS网格分页不起作用
- 在 Extjs 网格视图中隐藏行不起作用
- Extjs 4.1.1 在日期选择器中添加了新按钮,但其处理程序不起作用
- ExtJS 6树面板滚动不起作用
- 带有上传功能的提交表单不起作用-Extjs
- ExtJs 6.0.0.640-Ext.view.view-multiSelect配置不起作用
- extjs表中的动态url不起作用
- 为什么我带有关联的简单 ExtJS 数据示例不起作用
- extjs 示例代码不起作用
- 按钮上的overCls在ExtJS中不起作用