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 错误 这个可能与版本的问题 

    有很多梦想是遥不可及的,除非你坚持
  • 相关阅读:
    多线程之volatile关键字
    多线程具体实现
    多线程的概述
    Linux基本目录机构
    Java13新特性
    CF1316D【Nash Matrix】(dfs+构造+思维)
    ego商城项目学习总结+出现问题及解决
    java.lang.OutOfMemoryError: GC overhead limit exceeded之tomcat7优化
    jsp在tomcat中更新不起作用
    js取值及赋值
  • 原文地址:https://www.cnblogs.com/wuhanly/p/4133222.html
Copyright © 2011-2022 走看看