How to debug Extjs store url: path with firebug?

后端 未结 1 498
生来不讨喜
生来不讨喜 2020-12-12 04:35

I am using the browser-layout example for my application.

I\'m trying to add a tree grid to it. I defined a new class, but when I call my tree grid I can see the gr

相关标签:
1条回答
  • 2020-12-12 05:05
    var store = Ext.create('Ext.data.TreeStore', {
    proxy:{
        type: 'ajax',
        url: 'myTree.json',
    },
    reader:{
        type: 'ajax',
        root: 'nodes',
        record: 'leaf'
     }  
    }); 
    
    
    var myTree = Ext.create('Ext.tree.Panel', {
        store: store,
        rootVisible: false,  
        border: false,
        renderTo:Ext.getBody() //missing
    
    });  
    
    JSON
    
      {
    
        children: [
            { text:"Clients", expanded: true,
                children: [{ text:"MAIN", leaf: true }]
            }
        ]
      }
    

    Here is an working example, u can define myTree and call it in your Browser-layout!

    ScreenShot



    Go to firebug NET console, refresh the page and search for treeGrid.json, enter image description here

    Hover over with mouse to see full URL
    enter image description here
    Update store with correct path from localstore to a folder with your .json

    enter image description here
    Try now!

    0 讨论(0)
提交回复
热议问题