1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    3
    Vote Rating
    0
    Answers
    1
    kurochenko is on a distinguished road

      0  

    Default Answered: Tree Grit items are not visible in Chrome browser but in Firefox, Opera are

    Answered: Tree Grit items are not visible in Chrome browser but in Firefox, Opera are


    Hello, I was creating tree grid according to TreeGrid example. 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
    Code:
    
    {"text":".","children":[
            {
                    "id":null,
                    "name":"en",
                    "visible":false,
                    "expanded":true,
                    "leaf":false,
                    "children":{
                            "id":5,
                            "name":"/",
                            "visible":false,                        
                            "expanded":true,
                            "leaf":true,
                            "children":[]                        
                    }
            }]
    }
    Model
    Code:
    
    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
    Code:
    
    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
    Code:
    
    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
    Code:
    
    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.

  2. Argh, got it. I was really getting JSON in weird format from server (quotes escaped) and Chromium couldn't read such input I suppose
    Code:
    
    "{\"text\":\".\",\"children\":[{                
                   \"id\":null,                
                   \"name\":\"en\",               
                   \"visible\":false,                
                   \"expanded\":true,                
                   \"leaf\":false,                
                   \"children\":{                        
                                  \"id\":5,                        
                                  \"name\":\"/\",                        
                                  \"visible\":false,                                                
                                  \"expanded\":true,                        
                                  \"leaf\":true,                        
                                  \"children\":[]
                   }
    }]}"
    

  3. #2
    Sencha User
    Join Date
    Jul 2011
    Posts
    3
    Vote Rating
    0
    Answers
    1
    kurochenko is on a distinguished road

      0  

    Default


    Argh, got it. I was really getting JSON in weird format from server (quotes escaped) and Chromium couldn't read such input I suppose
    Code:
    
    "{\"text\":\".\",\"children\":[{                
                   \"id\":null,                
                   \"name\":\"en\",               
                   \"visible\":false,                
                   \"expanded\":true,                
                   \"leaf\":false,                
                   \"children\":{                        
                                  \"id\":5,                        
                                  \"name\":\"/\",                        
                                  \"visible\":false,                                                
                                  \"expanded\":true,                        
                                  \"leaf\":true,                        
                                  \"children\":[]
                   }
    }]}"