About

<#TEMPLATE_INCLUDE_NINEPAGE_ABOUTME#>
  • Mar

    12

    MinimalComps 带 Tree 组件

    • 0 Comments
    • Flash Platform

    MinimalComps 因为它的轻量级一直比较讨人喜欢,但它并没有内置的树组件。在 GitHub 上找到了一个带有 Tree 组件的版本。

    下载地址: minimalcomps-master.zip

    配置数据:

    //数据源配置
    var treeItems:Array = [
      { label:'treelist_test_app', items:[
        { label:'bin', expanded:false, items:[
          { label:'js', items:[
            { label:'swfobject.js' }
          ] },
          { label:'expressInstall.swf' },
          { label:'index.html' },
          { label:'TreeListTestApp.swf' }
        ] },
        { label:'lib', items:[] },
        { label:'obj' , items:[
          { label:'TreeListTestAppConfig.old' },
          { label:'TreeListTestAppConfig.xml' }
        ] },
        { label:'src', items:[] },
        { label:'file_tree_test.as' },
        { label:'TreeList Test App.as3proj' },
      ] }
    ];

    创建组件:

    //创建树组件
    testTree = new TreeList(mainContainer , 00, treeItems);
    testTree.setSize(200200);
    testTree.addEventListener(Event.SELECT, handleTestTreeSelect);

     侦听事件: 

    private function handleTestTreeSelect(e:Event):void
    {
      trace('TreeList select:', TreeList(e.target).selectedItem.label);
    }

    GitHub 链接:https://github.com/AdamHarte/minimalcomps

    原文链接:http://blog.adamharte.com/added-treelist-to-minimalcomps/