PDA

View Full Version : Tree Grit items are not visible in Chrome browser but in Firefox, Opera are



kurochenko
12 Aug 2011, 2:40 AM
Hello, I was creating tree grid according to TreeGrid example (http://dev.sencha.com/deploy/ext-4.0.2a/examples/tree/treegrid.html). And the result is correct in Firefox and Opera browsers. In Chorme/Chromium grid has no items - is empty. Also when I open aforementioned example in any browser everything is OK, when I copy example on my computer, items aren't visible (in Chrome) again.

JSON I'm getting from server


{"text":".","children":[
{
"id":null,
"name":"en",
"visible":false,
"expanded":true,
"leaf":false,
"children":{
"id":5,
"name":"/",
"visible":false,
"expanded":true,
"leaf":true,
"children":[]
}
}]
}
Model


Ext.define('Example.model.WebTreeItem',{
extend:'Ext.data.Model',
idProperty:'id',
fields:[
{name:'id', type:'int', defaultValue:0},
{name:'visible', type:'boolean'},
{name:'name', type:'string'}
]
});
Store


Ext.define('Example.store.WebTreeItems',{
extend:'Ext.data.TreeStore',
model:'Example.model.WebTreeItem',
autoLoad:true,
proxy:{
type:'ajax',
api:{
read :'getlist.json'
},
reader:{
type:'json'
}
}
});
View


Ext.define('Example.view.webitem.Tree',{
extend:'Ext.tree.Panel',
alias:'widget.webtreeitem',

title :'Web items',
store:'WebTreeItems',
rootVisible:false,
multiSelect:true,
singleExpand:false,
collapsible:true,
selModel:Ext.create('Ext.selection.CheckboxModel'),
height:800,
renderTo:'webstructure-tree',
columns:[{
xtype:'treecolumn',
text:'Name',
flex:2,
sortable:true,
dataIndex:'name'
},{
xtype:'booleancolumn',
text:'Visible',
flex:1,
dataIndex:'visible',
sortable:false
}],
viewConfig:{
plugins:{
ptype:'treeviewdragdrop'
}
}]
});
Dependencies are loaded automatically


Ext.Loader.setConfig({enabled:true});

Ext.application({
...
});

I'm using Firefox 5.0.1, Chromium 12, Chrome 13, Opera 11.50 all Linux versions. ExtJS 4.0.2a. In both Google products items aren't visible. Do you have any ideas why Chrome/Chromium doesn't show items? Thanks for any suggestions.

kurochenko
12 Aug 2011, 4:15 AM
Argh, got it. I was really getting JSON in weird format from server (quotes escaped) and Chromium couldn't read such input I suppose


"{\"text\":\".\",\"children\":[{
\"id\":null,
\"name\":\"en\",
\"visible\":false,
\"expanded\":true,
\"leaf\":false,
\"children\":{
\"id\":5,
\"name\":\"/\",
\"visible\":false,
\"expanded\":true,
\"leaf\":true,
\"children\":[]
}
}]}"