Flex-tree-control
フレックス-ツリーコントロール
前書き
Treeコントロールは、展開可能なツリーとして配置された階層データを表示します。
クラス宣言
以下は mx.controls.Tree クラスの宣言です-
パブリックプロパティ
Sr.No | Property & Description |
---|---|
1 |
dataDescriptor : mx.controls.treeClasses:ITreeDataDescriptor 現在のITreeDataDescriptorを返します。 |
2 |
dataProvider : Object [override] An object that contains the data to be displayed. |
3 |
dragMoveEnabled : Boolean [override] Indicates that items can be moved instead of just copied from the Tree control as part of a drag-and-drop operation. |
4 |
firstVisibleItem : Object ツリーの一番上の行に現在表示されているアイテム。 |
5 |
hasRoot : Boolean [read-only] Indicates that the current dataProvider has a root item; for example, a single top node in a hierarchical structure. |
6 |
itemIcons : Object アイテムのアイコンを指定するオブジェクト。 |
7 |
maxHorizontalScrollPosition : Number [override] The maximum value for the maxHorizontalScrollPosition property for the Tree control. |
8 |
openItems : Object 開かれた、または開かれたアイテム。 |
9 |
showRoot : Boolean ルートアイテムの可視性を設定します。 |
パブリックメソッド
Sr.No | Method & Description |
---|---|
1 |
Tree() コンストラクタ。 |
2 |
expandChildrenOf(item:Object, open:Boolean):void 指定されたアイテムの下のすべてのツリーアイテムを開閉します。 |
3 |
expandItem(item:Object, open:Boolean, animate:Boolean = false, dispatchEvent:Boolean = false, cause:Event = null):void ブランチアイテムを開閉します。 |
4 |
getParentItem(item:Object):* 子アイテムの既知の親を返します。 |
5 |
isItemOpen(item:Object):Boolean 指定された項目ブランチが開いている(子を表示している)場合、trueを返します。 |
6 |
setItemIcon(item:Object, iconID:Class, iconID2:Class):void アイテムに関連付けられたアイコンを設定します。 |
保護されたメソッド
Sr.No | Method & Description |
---|---|
1 |
dragCompleteHandler(event:DragEvent):void [override] Handles DragEvent.DRAG_COMPLETE events. |
2 |
dragDropHandler(event:DragEvent):void [override] Handles DragEvent.DRAG_DROP events. |
3 |
initListData(item:Object, treeListData:mx.controls.treeClasses:TreeListData):void ツリーアイテムレンダラーで使用されるTreeListDataオブジェクトを初期化します。 |
4 |
makeListData(data:Object, uid:String, rowNum:int):BaseListData [override] Creates a new TreeListData instance and populates the fields based on the input data provider item. |
イベント
Sr.No | Event & Description |
---|---|
1 |
itemClose ブランチが閉じられるか折りたたまれたときに送出されます。 |
2 |
itemOpen ブランチが開かれたとき、または展開されたときに送出されます。 |
3 |
itemOpening ブランチのオープンまたはクローズが開始されると送出されます。 |
継承されるメソッド
このクラスは、次のクラスからメソッドを継承します-
- mx.controls.List
- mx.controls.listClasess.ListBase
- mx.core.ScrollControlBase
- mx.core.UIComponent
- mx.core.FlexSprite
- flash.display.Sprite
- flash.display.DisplayObjectContainer
- flash.display.InteractiveObject
- flash.display.DisplayObject
- flash.events.EventDispatcher
- 対象
フレックスツリーコントロールの例
次の手順に従って、テストアプリケーションを作成して、Flexアプリケーションでのツリーコントロールの使用を確認します。
Step | Description |
---|---|
1 | Create a project with a name HelloWorld under a package com.finddevguides.client as explained in the Flex - Create Application chapter. |
2 | Modify HelloWorld.mxml as explained below. Keep rest of the files unchanged. |
3 | Compile and run the application to make sure business logic is working as per the requirements. |
以下は、変更されたmxmlファイル src/com.finddevguides/HelloWorld.mxml の内容です。
すべての変更が完了したら、link:/flex/flex_create_application [Flex-アプリケーションの作成]の章で行ったように、アプリケーションを通常モードでコンパイルして実行します。 アプリケーションに問題がなければ、次の結果が生成されます。[link:/flex/samples/ComplexControlsApplicationl#currentlyLoaded = Tree [Try it online]]