PDA

View Full Version : TreePanel error: An invalid or illegal string was specified code: 12



forumuser1080
14 Feb 2011, 10:09 AM
I have the following code running in xhtml and version 3.2.1 of extjs.



var json = [{
text: 'To Do',
cls: 'folder',
children: [{
text: 'Go jogging',
leaf: true
},{
text: 'Take a nap',
leaf: true
},{
text: 'Climb Everest',
leaf: true
}]
},{
text: 'Grocery List',
cls: 'folder',
children: [{
text: 'Bananas',
leaf: true
},{
text: 'Milk',
leaf: true
},{
text: 'Cereal',
leaf: true
},{
text: 'Energy foods',
cls: 'folder',
children: [{
text: 'Coffee',
leaf: true
},{
text: 'Red Bull',
leaf: true
}]
}]
},{
text: 'Remodel Project',
cls: 'folder',
children: [{
text: 'Finish the budget',
leaf: true
},{
text: 'Call contractors',
leaf: true
},{
text: 'Choose design',
leaf: true
}]
}];

var tree = new Ext.tree.TreePanel({
region: 'center',
collapsible: false,
title: 'My Task List',
height: 300,
width: 400,
useArrows:true,
autoScroll:true,
enableDD:false,
containerScroll: true,
rootVisible: false,
loader: new Ext.tree.TreeLoader(),
root: new Ext.tree.AsyncTreeNode({
text: 'Test',
rootVisible: true,
expanded: true,
children: json
})
});

var vp = new Ext.Viewport({
id: 'viewPort',
layout: 'border',
items: [tree]
});and when I run I get:
An invalid or illegal string was specified code: 12

arthurakay
14 Feb 2011, 12:50 PM
Can you upgrade to Ext 3.3.1, and/or remove the XHTML requirement?

I just tried running using 3.3.1 and no XHTML and it works fine.

forumuser1080
15 Feb 2011, 7:53 AM
No unfortunately I cannot remove either requirement, I need to stick with version 3.2.1 and xhtml.

I have confirmed that this is a bug only under xhtml. So I guess 3.2.1 is generating invalid xhtml for something in the TreePanel code.

Can anyone else verify this?

Is there a work around, can I modify my code in some way to make it work.

Thanks again.