Take this scenario:

 

.....

 

[Bindable] public var acAppts:ArrayCollection = new ArrayCollection();

 

private function sortDate(itemA:Object, itemB:Object):int 

{

return ObjectUtil.dateCompare( itemA.dtCreated,itemB.dtCreated);

}

 

 

.......

 

<mx:DataGrid x="0" y="20" width="{CELLWIDTH}" height="80" id="dgAppts"
headerHeight="0" dataProvider="{acAppts}" wordWrap="true"
editable="false" disabledColor="#c3c7c7" enabled="{!bDisabled}"
visible="{!bDisabled}" itemRollOut="deleteToolTip(event)"

      itemRollOver="createToolTip(event)"
itemClick="ShowReservationDetails();" change="sortArray()" >

      <mx:columns>

            <mx:DataGridColumn dataField="szReservation"/>  

            <mx:DataGridColumn dataField="dtCreated"
sortCompareFunction="sortDate" visible="true" />

      </mx:columns> 

</mx:DataGrid>

 

 

I should be sorting on the dtCreated field which is a date.  However,
it's not occurring.  If I set a breakpoint on the sortDate function, it
never gets hit.

 

I'm not sure if the reason is because the parent component populates the
acAppts which doesn't cause a trigger for the dataGrid to run the sort
function or what.  Anyone have an idea on what is going on with this?

Reply via email to