我最近在当前树列表中发现了一个对我来说至关重要的错误: 重现步骤:
结果:
它正在关闭列表。当您再次将鼠标悬停在菜单上时,它将引发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',
leaf: true
}, {
text: 'Video',
iconCls: 'x-fa fa-film',
leaf: true
}]
}, {
text: 'Users',
iconCls: 'x-fa fa-user',
children: [{
text: 'Tagged',
iconCls: 'x-fa fa-tag',
leaf: true
}, {
text: 'Inactive',
iconCls: 'x-fa fa-trash',
leaf: true
}]
}, {
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',
leaf: true
}, {
text: 'Notifications',
iconCls: 'x-fa fa-flag',
leaf: true
}, {
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}'
}
}]
});