Multi-line rows in tag grid
authorRichard Fairhurst <richard@systemeD.net>
Fri, 24 Mar 2017 14:43:15 +0000 (14:43 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Fri, 24 Mar 2017 14:43:15 +0000 (14:43 +0000)
net/systemeD/controls/DataGridWarningField.as
net/systemeD/potlatch2/TagGrid.mxml

index caa1423..4c1a971 100644 (file)
@@ -3,6 +3,7 @@ package net.systemeD.controls {
        import mx.controls.listClasses.*;
        import flash.display.DisplayObject;
        import mx.controls.Image;
+       import mx.controls.Text;
 
     /**
     * The DataGridWarningField is a custom Label component that highlights values containing semicolons.
@@ -12,7 +13,7 @@ package net.systemeD.controls {
     * @see PromptingTextInputWarning
     */
 
-       public class DataGridWarningField extends Label {
+       public class DataGridWarningField extends Text {
 
                private var _image:Image;
                [Embed(source="../../../embedded/warning.png")] private var warningIcon:Class;
index a04be01..5e1ca03 100644 (file)
@@ -5,6 +5,7 @@
 -->
 
 <mx:DataGrid editable="true" doubleClickEnabled="true" doubleClick="addNewTag(event)" sortableColumns="false"
+       variableRowHeight="true"
     xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:controls="net.systemeD.controls.*"
        xmlns:mx="library://ns.adobe.com/flex/mx">
@@ -30,7 +31,7 @@
 
                <!-- Value -->
 
-               <mx:DataGridColumn editable="true" dataField="value" headerText="Value" itemRenderer="net.systemeD.controls.DataGridWarningField" >
+               <mx:DataGridColumn wordWrap="true" editable="true" dataField="value" headerText="Value" itemRenderer="net.systemeD.controls.DataGridWarningField" >
                        <mx:itemEditor>
                                <fx:Component>
                                        <controls:AutoComplete
@@ -51,7 +52,7 @@
                <mx:DataGridColumn width="20" editable="false">
                        <mx:itemRenderer>
                                <fx:Component>
-                    <mx:HBox horizontalAlign="center" verticalAlign="middle">
+                    <mx:HBox horizontalAlign="center" verticalAlign="top">
                       <mx:Image source="@Embed('../../../embedded/delete_small.svg')"
                           click='event.stopPropagation();outerDocument.removeTag();'
                           buttonMode="true" useHandCursor="true" width="12" height="12">