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

    有很多梦想是遥不可及的,除非你坚持
  • 相关阅读:
    cacti (可以利用yum安装cacti的配置)
    zabbix
    HA集群
    DNS搭建
    MySQL主从配置
    解析jsp的 tomcat 、resin
    samba
    squid 代理服务
    Application binary interface and method of interfacing binary application program to digital computer
    Pyqt4的事件与信号
  • 原文地址:https://www.cnblogs.com/wuhanly/p/4133222.html
Copyright © 2011-2022 走看看