zoukankan      html  css  js  c++  java
  • Extjs加载本地的一个json文件


    <head>
        <title></title>
        <link href="../Styles/Extjs/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
        <script src="../Styles/Extjs/adapter/ext/ext-base.js" type="text/javascript"></script>
        <script src="../Styles/Extjs/extjs/ext-all-debug.js" type="text/javascript"></script>
        <script type="text/javascript">
            var tree = new Ext.tree.TreePanel({
                animate: true,
                renderTo: Ext.getBody(),
                rootVisible: true,
                autoScroll: true,
                autoHeight: true,
                lines: true,
                300,
                loader: new Ext.tree.TreeLoader({
                preloadChildren: true,
                clearOnLoad: false,
                 dataUrl: 'data.json'
                }),
                root: new Ext.tree.AsyncTreeNode({
                    text: 'Extjs',
                    id: 'root',
                    expanded: false
                }),
                collapseFirst: false
            });
           
           
        </script>
    </head>
    <body>
    </body>
    </html>

    在json文件中添加自己的想要加载的树节点 类似:[    
       {'text':'not leaf',children:[{'text':'is leaf',leaf:true}]},    
        {'text':'is leaf',leaf:true}    
    ]  

    有时候加载的时候 提示http 405 错误 这个可能与版本的问题 

    有很多梦想是遥不可及的,除非你坚持
  • 相关阅读:
    那些ubuntu创建用户踩过的坑
    Build tools
    version control(以git为例)讲解
    URI和URL的区别
    HTTP解析过程心得
    函数式编程(functional programming)
    cb45a_c++_STL_算法_删除_(3)_unique(唯一的意思)删除连续性的重复的数据
    cb44a_c++_STL_算法_删除_(2)remove_copy_remove_copy_if
    cb43a_c++_STL_算法_删除_(1)remove_remove_if
    cb42a_c++_STL_算法_替换_replace
  • 原文地址:https://www.cnblogs.com/wuhanly/p/4133222.html
Copyright © 2011-2022 走看看