且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何调试 Extjs store url: path with firebug?

更新时间:2023-12-05 10:32:04

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 }]
        }
    ]
  }

这是一个工作示例,您可以定义 myTree 并在浏览器布局中调用它!

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



进入 firebug NET 控制台,刷新页面并搜索 treeGrid.json,

用鼠标悬停以查看完整网址

使用从 localstore 到带有 .json 的文件夹的正确路径更新存储


立即尝试!

Go to firebug NET console, refresh the page and search for treeGrid.json,

Hover over with mouse to see full URL

Update store with correct path from localstore to a folder with your .json


Try now!