PDA

View Full Version : [FIXED-EXTJSIV-2009]tree check node should be boolean (4.0.1)



christophe.geiser
19 May 2011, 11:06 PM
Hi
In the function decorate (line 51054), we have:


newFields = this.applyFields(modelClass, [
{name: idName, type: 'string', defaultValue: null},
{name: 'parentId', type: 'string', defaultValue: null},
{name: 'index', type: 'int', defaultValue: null},
{name: 'depth', type: 'int', defaultValue: 0},
{name: 'expanded', type: 'bool', defaultValue: false, persist: false},
{name: 'checked', type: 'auto', defaultValue: null},
{name: 'leaf', type: 'bool', defaultValue: false, persist: false},
{name: 'cls', type: 'string', defaultValue: null, persist: false},
{name: 'iconCls', type: 'string', defaultValue: null, persist: false},
{name: 'root', type: 'boolean', defaultValue: false, persist: false},
{name: 'isLast', type: 'boolean', defaultValue: false, persist: false},
{name: 'isFirst', type: 'boolean', defaultValue: false, persist: false},
{name: 'allowDrop', type: 'boolean', defaultValue: true, persist: false},
{name: 'allowDrag', type: 'boolean', defaultValue: true, persist: false},
{name: 'loaded', type: 'boolean', defaultValue: false, persist: false},
{name: 'loading', type: 'boolean', defaultValue: false, persist: false},
{name: 'href', type: 'string', defaultValue: null, persist: false},
{name: 'hrefTarget',type: 'string', defaultValue: null, persist: false},
{name: 'qtip', type: 'string', defaultValue: null, persist: false},
{name: 'qtitle', type: 'string', defaultValue: null, persist: false}
]);


'checked' should be of type boolean, otherwise an xml record such as:


<node>
<text>node</text>
<checked>false</checked>
</node>


is interpreted as 'checked = true'
Cheers
C.

evant
19 May 2011, 11:41 PM
Thanks for the report, will be fixed in the next patch.

For those playing at home you should also add a "useNull: true" onto the field definition.

christophe.geiser
20 May 2011, 1:49 AM
Thanks a lot,
Seems there is also a problem with loading nested data to tree as reported under the help section here (http://www.sencha.com/forum/showthread.php?134059-cannot-load-xml-nested-data-to-tree-(4.0.1)). it might be a bug though.

Cheers,
C.