如何解决错误:扩展弹出菜单的一部分节点时,ExtJS TreeList Microview损坏
我最近在当前树列表中发现了一个对我来说至关重要的错误: 重现步骤:
- 打开Fiddle
- 点击“微型”按钮
- 将鼠标悬停在“主页”图标上以查看弹出子导航
- 点击“存档”后面的箭头
结果:
它正在关闭列表。当您再次将鼠标悬停在菜单上时,它将引发js错误:Uncaught TypeError: Cannot read property 'un' of null at constructor.unfloatAll (ext-all-debug.js:144478)
如果再次将鼠标悬停在它上面,它将打开,并且列表按预期扩展。
已预期:展开子菜单之一后,悬停菜单不会关闭。它将保持打开状态并正确展开列表。
这是在Ext6.2上运行的,并且至少从7.2开始就被破坏了(尚未测试以前的版本)。
任何解决方法或覆盖方法将不胜感激。
Ext.define('KitchenSink.view.grid.TreeListController',{
extend: 'Ext.app.ViewController',alias: 'controller.tree-list',onMicroPressedChange: function(button,pressed) {
var treelist = this.lookupReference('treelist'),width = !treelist.getMicro() ? 44 : 250;
treelist.setMicro(!treelist.getMicro());
treelist.setWidth(width);
}
});
Ext.define('KitchenSink.view.grid.TreeListModel',{
extend: 'Ext.app.ViewModel',alias: 'viewmodel.tree-list',stores: {
navItems: {
type: 'tree',rootVisible: true,root: {
expanded: true,text: 'All',children: [{
text: 'Home',iconCls: 'x-fa fa-home',children: [{
text: 'Messages',iconCls: 'x-fa fa-inbox',leaf: true
},{
text: 'Archive',href: '',iconCls: 'x-fa fa-database',children: [{
text: 'First',iconCls: 'x-fa fa-sliders',leaf: true
},{
text: 'No Icon',iconCls: null,leaf: true
}]
},{
text: 'Music',iconCls: 'x-fa fa-music',{
text: 'Video',iconCls: 'x-fa fa-film',leaf: true
}]
},{
text: 'Users',iconCls: 'x-fa fa-user',children: [{
text: 'Tagged',iconCls: 'x-fa fa-tag',{
text: 'Inactive',iconCls: 'x-fa fa-trash',{
text: 'Groups',iconCls: 'x-fa fa-group',leaf: true
},{
text: 'Settings',iconCls: 'x-fa fa-wrench',children: [{
text: 'Sharing',iconCls: 'x-fa fa-share-alt',{
text: 'Notifications',iconCls: 'x-fa fa-flag',{
text: 'Network',iconCls: 'x-fa fa-signal',leaf: true
}]
}]
}
}
}
});
Ext.define('KitchenSink.view.grid.TreeList',{
extend: 'Ext.Panel',requires: [
'Ext.list.Tree','Ext.list.TreeItem'
],xtype: 'tree-list',title: 'TreeList',controller: 'tree-list',layout: {
type: 'vbox',align: 'stretch'
},viewModel: {
type: 'tree-list'
},items: [{
xtype: 'container',flex: 1,scrollable: 'y',items: [{
xtype: 'toolbar',docked: 'top',border: false,items: [{
xtype: 'button',allowMultiple: true,text: 'Micro',handler: 'onMicroPressedChange'
}]
},{
xtype: 'treelist',reference: 'treelist',bind: '{navItems}'
}]
},{
xtype: 'component',cls: 'treelist-log',padding: 10,height: 50,bind: {
html: '{selectionText}'
}
}]
});
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。