PDA

View Full Version : defaultRootId is not working in TreeStore



khashayar581
13 Sep 2011, 2:40 AM
Sencha Touch version tested:

1.1.0

{defaultRootId} config option is not working in TreeStore


Description:

If you set 'defaultRootId' config, TreeStore will not use it.



1) There is a problem on TreeStore's constructor:
In line 3 of constructor:


rootCfg.id = rootCfg.id || this.defaultRootId;

As you see, there's no Ext.apply(this.config) before this line, so this.defaultRootId would point to 'root' value instead of the config.defaultRootId value.


2) Another issue is on the load() method on TreeStore, There's a line:


options.params[this.nodeParam] = record ? record.getId() : 'root';

I think this should be change to:


options.params[this.nodeParam] = record ? record.getId() : this.defaultRootId;