4/12/2012

Ext JS 4 TreeStore load problem

There is a minor bug in TreeStore load() method. If your tree has no root(dont ask why you use tree if you dont have a root), load method will crash since it calls removeAll() method which tries  and fails to find root.

Solution: set clearOnLoad = false in config.

If you want to clear before load, you can call:
this.fireEvent('clear',this);

References:
http://www.sencha.com/forum/showthread.php?170617-Ext.data.treeStore.removeAll-is-an-unsafe-method
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.TreeStore-method-load

No comments:

Post a Comment