Ext.js5树—基本树(54)

view

/**
 * This example demonstrates basic tree configuration.
 * 这个例子展示了树的配置
 */
Ext.define('KitchenSink.view.tree.BasicTrees', {
    extend: 'Ext.Container',
    xtype: 'basic-trees',
    width: 640,

    layout: {
        type: 'table',
        columns: 2,
        tdAttrs: { style: 'padding: 10px;' }
    },

    defaults: {
        xtype: 'treepanel',
        width: 300,
        height: 200,
        //设置为false,在本store的数据集合中不包含根节点
        rootVisible: false,
        // Sharing the store synchronizes(同步) the views:
        store: 'Files'
    },

    initComponent: function() {
        this.items = [
            {
                title: 'Tree'
            },
            {
            //没有线的树
                title: 'Tree with No Lines',
                lines: false
            },
            {
            //使用箭头
                title: 'Tree with Arrows',
                useArrows: true,
                colspan: 2
            }
        ];

        this.callParent();
    }
});

store

Ext.define('KitchenSink.store.Files', {
    extend: 'Ext.data.TreeStore',

    root: {
        text: 'Ext JS',
        expanded: true,
        children: [
            {
                text: 'app',
                children: [
                    { leaf:true, text: 'Application.js' }
                ]
            },
            {
                text: 'button',
                //默认为展开的
                expanded: true,
                children: [
                    { leaf:true, text: 'Button.js' },
                    { leaf:true, text: 'Cycle.js' },
                    { leaf:true, text: 'Split.js' }
                ]
            },
            {
                text: 'container',
                children: [
                    { leaf:true, text: 'ButtonGroup.js' },
                    { leaf:true, text: 'Container.js' },
                    { leaf:true, text: 'Viewport.js' }
                ]
            },
            {
                text: 'core',
                children: [
                    {
                        text: 'dom',
                        children: [
                            { leaf:true, text: 'Element.form.js' },
                            { leaf:true, text: 'Element.static-more.js' }
                        ]
                    }
                ]
            },
            {
                text: 'dd',
                children: [
                    { leaf:true, text: 'DD.js' },
                    { leaf:true, text: 'DDProxy.js' },
                    { leaf:true, text: 'DDTarget.js' },
                    { leaf:true, text: 'DragDrop.js' },
                    { leaf:true, text: 'DragDropManager.js' },
                    { leaf:true, text: 'DragSource.js' },
                    { leaf:true, text: 'DragTracker.js' },
                    { leaf:true, text: 'DragZone.js' },
                    { leaf:true, text: 'DragTarget.js' },
                    { leaf:true, text: 'DragZone.js' },
                    { leaf:true, text: 'Registry.js' },
                    { leaf:true, text: 'ScrollManager.js' },
                    { leaf:true, text: 'StatusProxy.js' }
                ]
            },
            {
                text: 'core',
                children: [
                    { leaf:true, text: 'Element.alignment.js' },
                    { leaf:true, text: 'Element.anim.js' },
                    { leaf:true, text: 'Element.dd.js' },
                    { leaf:true, text: 'Element.fx.js' },
                    { leaf:true, text: 'Element.js' },
                    { leaf:true, text: 'Element.position.js' },
                    { leaf:true, text: 'Element.scroll.js' },
                    { leaf:true, text: 'Element.style.js' },
                    { leaf:true, text: 'Element.traversal.js' },
                    { leaf:true, text: 'Helper.js' },
                    { leaf:true, text: 'Query.js' }
                ]
            },
            { leaf:true, text: 'Action.js' },
            { leaf:true, text: 'Component.js' },
            { leaf:true, text: 'Editor.js' },
            { leaf:true, text: 'Img.js' },
            { leaf:true, text: 'Layer.js' },
            { leaf:true, text: 'LoadMask.js' },
            { leaf:true, text: 'ProgressBar.js' },
            { leaf:true, text: 'Shadow.js' },
            { leaf:true, text: 'ShadowPool.js' },
            { leaf:true, text: 'ZIndexManager.js' }
        ]
    }
});

感慨:老大一走俩月,不闻不问不管,我的状态已濒临崩溃。什么时候开始做事儿?我的耐心耐心耐心,我感觉就像沙漠里的绿洲,迟早会被晒干的。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值