PDA

View Full Version : [OPEN] [4.2.3] Bug in NodeInterface.removeAll(true)



Werzi2001
29 Apr 2015, 3:02 AM
Ext version tested:


Ext 4.2.3


Browser versions tested against:


Not relevant


DOCTYPE tested against:


Not relevant


Description:


Use this example code


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<link rel="stylesheet" type="text/css" href="./extjs/resources/css/ext-all-gray.css"/>
<script type="text/javascript" src="./extjs/ext-all-debug.js"></script>

<script type="text/javascript">
Ext.onReady(function() {
var panel = Ext.create('Ext.tree.Panel', {
renderTo: document.body,
width: 300,
height: 500,
autoScroll: true,
animate: false,
rootVisible: false,
hideHeaders: true,
columns: [{
xtype: 'treecolumn',
dataIndex: 'text',
flex: 1
}],
store: Ext.create('Ext.data.TreeStore', {
fields: ['id', 'text'],
root: {
id: 'ROOT',
text: 'ROOT',
children: [{
id: '1',
text: '1'
}, {
id: '2',
text: '2'
}, {
id: '3',
text: '3'
}, {
id: '4',
text: '4'
}, {
id: '5',
text: '5',
children: [{
id: '5.1',
text: '5.1'
}]
}]
}
})
});

var button = Ext.create('Ext.button.Button', {
renderTo: document.body,
text: 'Click me',
listeners: {
click: function(btn, e, eopts) {
panel.getStore().getRootNode().removeAll(true);
}
}
});
});
</script>
</head>
<body></body>
</html>

Steps to reproduce the problem:


Click on button


The result that was expected:


All elements removed
No exception


The result that occurs instead:


Exception occurs (store.indexOf is not a function)


Debugging:

This line triggers the exception as indexOf does not exist for a TreeStore:


store.fireEvent('bulkremove', store, [me], [store.indexOf(me)], false);

tristan.lee
29 Apr 2015, 12:42 PM
Hi,

Thanks for reporting the issue. I've made this issue aware to our engineering team.

Thanks,
Tristan