Check out the advancedDataGrid below in the ***s. After I group I loose the
sorting I applied to the dataprovider, and no matter what I try or when I
try it, sorting the dataprovider has no effect. But the user can sort by
clicking on a column header. So I want to simulate that click in a function
but I am having no success.

I'm trying this code in the ///s and calling it after I refresh the grouping
collection. I know this code isn't breaking with any sort of error cause the
Alert.show I fire right after it works fine. Anyone know what I'm doing
wrong?

////////////////////////////////////////////////////////
gridTemplates.dispatchEvent(
    new AdvancedDataGridEvent(
        AdvancedDataGridEvent.HEADER_RELEASE,
        false,
        false,
        0
    )
);
////////////////////////////////////////////////////////





Here's the AdvancedDataGrid:
***********************************************************
<mx:AdvancedDataGrid defaultLeafIcon="{null}" folderClosedIcon="{null}"
folderOpenIcon="{null}"
        displayItemsExpanded="true" id="gridTemplates" left="10" right="10"
top="10" bottom="50" click="gridClick();"
        >
        
        <mx:dataProvider>
                <mx:GroupingCollection id="gc" source="{acTemplates}">
                        <mx:Grouping>
                                <mx:GroupingField name="templateTypeID">
                                        <mx:SummaryRow summaryPlacement="group">
                                                <mx:fields>
                                                        <mx:SummaryField 
dataField="templateTypeID" label="templateTypeID" />
                                                </mx:fields>
                                        </mx:SummaryRow>
                                </mx:GroupingField>
                        </mx:Grouping>
                </mx:GroupingCollection>
        </mx:dataProvider>
        <mx:columns>
                <mx:AdvancedDataGridColumn dataField="name" headerText="Formal 
Name"
width="280"/>  
                <mx:AdvancedDataGridColumn dataField="abbreviation" 
headerText="Short
Name" width="150"/>
                <mx:AdvancedDataGridColumn dataField="insertDate" 
headerText="Date
Created" width="150"/>
                <mx:AdvancedDataGridColumn dataField="templateID" width="0"
visible="false"/>
        </mx:columns>
        <mx:rendererProviders>
                <mx:AdvancedDataGridRendererProvider dataField="templateTypeID"
                                                                                
         columnIndex="0"
                                                                                
         columnSpan="0"
                                                                                
         depth="1"
                                                                                
         renderer="SummaryRenderer"/>
        </mx:rendererProviders>

</mx:AdvancedDataGrid>
***********************************************************
-- 
View this message in context: 
http://old.nabble.com/Help%21---AdvancedDataGrid---Applying-sort-as-if-user-clicked-column-header-tp26443587p26443587.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to