This is an automated email from the ASF dual-hosted git repository.

pushminakazi pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 40343f8  Update ListBase.as added dataTipFunction property
40343f8 is described below

commit 40343f8235978cc03fdaa8f4c5218002fd3ce068
Author: pashminakazi <[email protected]>
AuthorDate: Thu Dec 17 19:45:09 2020 +0500

    Update ListBase.as added dataTipFunction property
---
 .../royale/mx/controls/listClasses/ListBase.as     | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
index 9a9fab4..15b8aac 100644
--- 
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
+++ 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
@@ -1486,6 +1486,63 @@ use namespace mx_internal;
             
             return " ";
         }
+       
+        //----------------------------------
+    //  dataTipFunction
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the dataTipFunction property.
+     */
+       protected var itemsSizeChanged:Boolean = false;
+    private var _dataTipFunction:Function;
+
+    [Bindable("dataTipFunctionChanged")]
+    [Inspectable(category="Data")]
+
+    /**
+     *  User-supplied function to run on each item to determine its dataTip.  
+     *  By default, the list looks for a property named <code>label</code> 
+     *  on each data provider item and displays it.
+     *  However, some items do not have a <code>label</code> property 
+     *  nor do they have another property that can be used for displaying 
+     *  in the rows. An example is a data set that has lastName and firstName 
+     *  fields, but you want to display full names. You can supply a 
+     *  <code>dataTipFunction</code> that finds the appropriate
+     *  fields and return a displayable string. The 
+     *  <code>dataTipFunction</code> is also good for handling formatting
+     *  and localization.
+     *
+     *  <p>The dataTipFunction takes a single argument which is the item
+     *  in the data provider and returns a String, as the following example 
shows:</p>
+     * 
+     *  <pre>myDataTipFunction(item:Object):String</pre>
+     * 
+     *  @default null
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get dataTipFunction():Function
+    {
+        return _dataTipFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set dataTipFunction(value:Function):void
+    {
+        _dataTipFunction = value;
+
+        itemsSizeChanged = true;
+        invalidateDisplayList();
+
+        dispatchEvent(new Event("dataTipFunctionChanged"));
+    }
 
     }
 }

Reply via email to