-
25 Sep 2012 5:51 AM #1
[4.1.2] Root not visible, error in tree
[4.1.2] Root not visible, error in tree
Hi,
I'm upgrading from 4.1.1 to 4.1.2 (a) and noticed a bug in the new bulkupdate/edit feature of the tree store.
Situation: A TreeStore within a TreePanel with a remote tree (json returns a collection of items = nodes).
If the root node is disabled (via rootVisible=false) or the root node is expanded at default, the script breaks at a NPE:
File Ext.view.Table l. 467 of refreshSize "me.table.attach(me.el.child('table', true));"
The object "me.el" is null.
My Patch:PHP Code:refreshSize: function() {
var me = this,
cmp;
// On every update of the layout system due to data update, capture the table's DOM in our private flyweight
me.table.attach(me.el.child('table', true));
if (!me.hasLoadingHeight) {
Actually, I'd only added a wrapper (if me.el) and changed the "this.callParent" with an explicit call of the parent view.. this.callParent called the Ext.view.Table.refreshSize...??)PHP Code:Ext.override(Ext.view.Table, {
refreshSize : function() {
var me = this, cmp;
// On every update of the layout system due to data update, capture the table's DOM in our private flyweight
if (me.el) {
me.table.attach(me.el.child('table', true));
}
if (!me.hasLoadingHeight) {
cmp = me.up('tablepanel');
// Suspend layouts in case the superclass requests a layout. We might too, so they
// must be coalescsed.
Ext.suspendLayouts();
Ext.view.AbstractView.prototype.refreshSize.call(this);
// If the OS displays scrollbars, and we are overflowing vertically, ensure the
// HeaderContainer accounts for the scrollbar.
if (cmp && Ext.getScrollbarSize().width && (me.autoScroll || me.overflowY)) {
cmp.updateLayout();
}
Ext.resumeLayouts(true);
}
}
});
Do you need additional information and/or demo? I'm currently a little bit busy.. next days/next week.
-
25 Sep 2012 5:57 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,682
- Vote Rating
- 435
Using the check-tree.html example I'm not getting an error and it has rootVisible : false.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
25 Sep 2012 6:12 AM #3
Oops, I'd forgotten the title... :/
Is there is possibility to get a "public" extjs 4.1.2? Otherwise I can only provide a non-public web-demo.
-
25 Sep 2012 6:28 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,682
- Vote Rating
- 435
4.1.2 is only for support subscribers
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
25 Sep 2012 1:24 PM #5Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
26 Sep 2012 9:20 AM #6
Okay.
I'd already spent some hours to reproduce it.. and finally, I can tell you following.
First: In the attachment you find a zip containing the actual test case with a bootstrap index.html and an app.js. Furthermore, this requires a dynamic tree store so I provide you a nodejs script to boot up a small server which fakes a dynamic tree where each node will loaded async.
I.e.
Second: ReproduceCode:node server.js Server running at http://127.0.0.1:8125/
* Expand each node to "Customers / Customer 1 / Hosts / Host A" and select it.
* Hit "refresh" -> error in console.
Third: This actually means, that the bug has nothing to to with the root node. It has actually occured earlier because the root node was expanded.
Fouth: I add the following video demo so that you can actually see the problem: http://screencast.com/t/SmEXpp5YQLhO
Fifth: So long, the problem occours in the "updateIndexes" method of Ext.view.AbstractView (ll 792). If I understand this correct, the method is used to synchronize the nodeInternalId from the record TO the dom element. This is okay in most cases but exactly in THIS case not. I noticed that the dom elements have an element twice (which is incorrect), so that "ns" is one element larger than "records" and therefor will produce a npe at line 801.
-
26 Sep 2012 9:21 AM #7
should I open a new thread?
This issue duplicates another issue.


Reply With Quote