zoukankan      html  css  js  c++  java
  • ExtJs学习笔记1

        <script type="text/javascript">
            Ext.onReady(function () {
                var root = new Ext.tree.AsyncTreeNode({
                    text: "根节点",
                    id: "-1",
                    children: [{ text: "子节点1", id: "1",leaf:true },{text: "子节点1", id: "1",leaf:true}]
                })
                var tree = new Ext.tree.TreePanel({
                    height: 10000,
                    renderTo:"div1"
                    1000,
                    title: "我的第一课树",
                    root: root,
                    loader: new Ext.tree.TreeLoader()
                });
            });
        </script>

    <div id="div1"></div>

    显示一棵树的时候,我们可以通过

    从后台获取json数据绑定children配置项里

    还有注意的一点:加上loader: new Ext.tree.TreeLoader()配置项,虽然我到现在都不明白为什么要加上这个?

    但不加上的话,显示不了树

  • 相关阅读:
    004---基于TCP的套接字
    003---socket介绍
    002---tcp/ip五层详解
    001---C/S架构
    008---re正则模块
    007---logging日志模块
    006---hashlib模块
    005---json & pickle
    004---os & sys
    22.解决 eclipse 与 AS 共用 SDK 导致 eclipse ADT 无法使用的问题
  • 原文地址:https://www.cnblogs.com/walleyekneel/p/2174008.html
Copyright © 2011-2022 走看看