[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header
Bumping this cause I'm still searching. --- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote: So can anyone tell me how to sort when using a grouping collection? The GC is sorted how I want it, but I want the rest of them to default to being sorted as if the user had clicked on the header of the first column. I can't find help on this anywhere. Thanks in advance.
[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header
Tried to bump this earlier, must have done something wrong, but apologies if I double post. I'm bumping because I'm still having a problem with this. Can anyone help me out?
[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header
Maybe one of these would help: http://cookbooks.adobe.com/post_How_to_sort_items_within_group_in_AdvancedDataGrid-13047.html http://stackoverflow.com/questions/155279/how-do-i-sort-in-a-flex-advanceddatagrid-callback-isnt-being-called http://flexpearls.blogspot.com/2008/01/using-advanceddatagrid-as-tree-control.html --- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote: Tried to bump this earlier, must have done something wrong, but apologies if I double post. I'm bumping because I'm still having a problem with this. Can anyone help me out?
[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header
Valdhor you are a life saver. I hadn't found that first link in my searching and it cleared everything up for me. Thank you so much. I think that's twice you assisted me. I might owe you a beer soon. Thanks ~Mike --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote: Maybe one of these would help: http://cookbooks.adobe.com/post_How_to_sort_items_within_group_in_AdvancedDataGrid-13047.html http://stackoverflow.com/questions/155279/how-do-i-sort-in-a-flex-advanceddatagrid-callback-isnt-being-called http://flexpearls.blogspot.com/2008/01/using-advanceddatagrid-as-tree-control.html
[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header
Glad to be of assistance. Steve --- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote: Valdhor you are a life saver. I hadn't found that first link in my searching and it cleared everything up for me. Thank you so much. I think that's twice you assisted me. I might owe you a beer soon. Thanks ~Mike --- In flexcoders@yahoogroups.com, valdhor valdhorlists@ wrote: Maybe one of these would help: http://cookbooks.adobe.com/post_How_to_sort_items_within_group_in_AdvancedDataGrid-13047.html http://stackoverflow.com/questions/155279/how-do-i-sort-in-a-flex-advanceddatagrid-callback-isnt-being-called http://flexpearls.blogspot.com/2008/01/using-advanceddatagrid-as-tree-control.html
[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header
So can anyone tell me how to sort when using a grouping collection? The GC is sorted how I want it, but I want the rest of them to default to being sorted as if the user had clicked on the header of the first column. I can't find help on this anywhere. Thanks in advance. --- In flexcoders@yahoogroups.com, tntomek tnto...@... wrote: Grouping data provider has its own sort property that is separate from the base sort on your ArrayCollection, you will have to specify that in one of the group of grouping field properties
[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header
Nothing is happening because the event has no context of the column that was supposedly clicked, try adding more arguments into the createEvent method. Having said that, this is probably not the recommended way of programmaticaly invoking sort on the grid. Have a look around there we some threads about this a few days ago. Ideally what you want to do is update the sort property on your dataProvider, this will dispatch events to the grid and it should draw itself correctly. --- In flexcoders@yahoogroups.com, InvertedSpear invertedsp...@... wrote: 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.
[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header
The last argument in the function is the index of the column (0, which is the first, I have also tried 1 and 2 just to see if I could get something to happen. Sorting the dataprovider doesn't work with the grouping for some reason. If I need more arguments in the dispatch event, which ones do I need? --- In flexcoders@yahoogroups.com, tntomek tnto...@... wrote: Nothing is happening because the event has no context of the column that was supposedly clicked, try adding more arguments into the createEvent method. Having said that, this is probably not the recommended way of programmaticaly invoking sort on the grid. Have a look around there we some threads about this a few days ago. Ideally what you want to do is update the sort property on your dataProvider, this will dispatch events to the grid and it should draw itself correctly.
[flexcoders] Re: Help! - AdvancedDataGrid - Applying sort as if user clicked column header
Grouping data provider has its own sort property that is separate from the base sort on your ArrayCollection, you will have to specify that in one of the group of grouping field properties --- In flexcoders@yahoogroups.com, invertedspear invertedsp...@... wrote: The last argument in the function is the index of the column (0, which is the first, I have also tried 1 and 2 just to see if I could get something to happen. Sorting the dataprovider doesn't work with the grouping for some reason. If I need more arguments in the dispatch event, which ones do I need? --- In flexcoders@yahoogroups.com, tntomek tntomek@ wrote: Nothing is happening because the event has no context of the column that was supposedly clicked, try adding more arguments into the createEvent method. Having said that, this is probably not the recommended way of programmaticaly invoking sort on the grid. Have a look around there we some threads about this a few days ago. Ideally what you want to do is update the sort property on your dataProvider, this will dispatch events to the grid and it should draw itself correctly.