Relax Breath of Solution.Community tech blog of Sameera Thilakasiri - Consultant UI, UX, RWD Specialist/ Interactive Designer

Just I wanted.. Do you?…

Determining a DataGridColumn object’s current sort order – callLater()

Posted on May 27, 2010 | No Comments

The callLater() method queues an operation to be performed for the next screen refresh, rather than in the current update. Without the callLater() method, you might try to access a property of a component that is not yet available. The callLater() method is most commonly used with the creationComplete event to ensure that a component has finished being created before Flex proceeds with a specified method call on that component.

All objects that inherit from the UIComponent class can open the callLater() method. It has the following signature:
callLater(method:Function, args:Array):void

The following example uses a call to the callLater() method to ensure that new data is added to a DataGrid before Flex tries to put focus on the new row. Without the callLater() method

<?xml   version="1.0"   encoding="utf-8"?>
<mx:Application name="DataGridColumn_sortDescending_test"

            import mx.controls.dataGridClasses.DataGridColumn;

              private function doHeaderRelease(evt:DataGridEvent):void     {
                  var column:DataGridColumn = DataGridColumn(evt.currentTarget.columns[evt.columnIndex]);
                      DataGrid(evt.currentTarget).callLater(onCallLater,   [column]);

            private   function onCallLater(column:DataGridColumn):void {
                columnSortDescending.text = column.dataField + ".sortDescending: " + column.sortDescending;

      <mx:ApplicationControlBar   dock="true">
 <a href="">buy cialis canadian</a>         &lt;mx:Label id=&quot;columnSortDescending&quot; /&gt;

      &lt;mx:DataGrid id=&quot;dataGrid&quot;
            &lt;mx:DataGridColumn id=&quot;col1&quot;   dataField=&quot;label&quot;     /&gt;
            &lt;mx:DataGridColumn id=&quot;col2&quot; dataField=&quot;data&quot;   /&gt;
                  &lt;mx:Object data=&quot;one&quot; label=&quot;User   1&quot; /&gt;
                &lt;mx:Object data=&quot;two&quot;   label=&quot;User 2&quot; /&gt;


Sameera Thilakasiri By Sameera Thilakasiri
,is a front-end developer based in Colombo, is a blogger and a lifestyle photographer.
Follow him Twitter and Google+. Check out him.


Leave a Reply

You must be logged in to post a comment.