Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
ANSCORP #1
AdvancedDataGrid Sorting
I'm having a problem getting an AdvancedDataGrid to sort data in the proper
order. I'm using a GroupingCollection as the dataprovider and I have two
fields that are being grouped and sorted correctly. However, the children of
the second grouping (the detail records) are not being sorted correctly. I've
attempted changing the order in which the data is delivered by the SQL call,
I've attempted applying a sort function to both the ArrayCollection and
GroupingCollection, but nothing seems to work. If I make the detail records
their own group (groupingField), the sort sequence is correct, but the Grid
does not look very good that way. Has anyone run into this problem? I thought
that identifying the detail field in the GroupingCollection "childrenField"
parameter would correct the problem, but it throws an RTE (type coercion
error). Any advice would be appreciated.
Thank You,
M. McConnell
ANSCORP Guest
-
Stuck in the AdvancedDatagrid
Hi All, I want to access the data within the Advanced Datagrid but I cant seem to do it. I have defined some summary data using Grouping... -
Question for AdvancedDataGrid?
Hi, I did a AdvancedDataGrid without grouping,it works fine. <mx:AdvancedDataGri d x="8" y="72" width="558" height="247" rowCount="4"... -
AdvancedDataGrid and HierarchicalData
I'm having a problem with the AdvancedDataGrid and HierachicalData. I have an HTTPService that is getting data from an XML file off the server. I... -
AdvancedDataGrid styling help
Hello, I am trying to style an ADG such that certain horizontal lines in the grid are rendered with larger line thicknesses. I have tried a... -
Could not resolve <mx:AdvancedDataGrid>
hi, all, I don't have much experience on Flex, and I met this problem when I try to open my mxml on Tomcat: Could not resolve... -
Sreenivas R #2
Re: AdvancedDataGrid Sorting
To get sorting to work properly you need to apply sorting after supplying
GroupingCollection as dataProvider to ADG and refreshing it.
adg.dataProvider = gc;
gc.refresh();
adg.dataProvider.sort = new Sort();
...set up fields....
Have you followed these steps? If you have and still it is not working it
would be of great help if you can post some sample code which shows the problem.
Sreenivas R Guest
-
ANSCORP #3
Re: AdvancedDataGrid Sorting
Yes....I had already tried that method. It did not work for me. I can't
reveal too much of the code, but here is the Actionscript function that
receives the database query results and proceeds to populate the
GroupingCollection and ADG:
private function getMarginReport_result(event:ResultEvent):void{
marginReportData = event.result as ArrayCollection;
this.invDate = new Date(this.marginReportData[0].invoicedate);
this.weDate = new Date(this.marginReportData[0].weekenddate);
this.pwDate = new Date(this.marginReportData[0].pwinvoicedate);
this.marginReportHeader = "Margin Report for Billing Date " +
formatDate.format(this.invDate) + " for Activity Week Ending " +
formatDate.format(this.weDate);
gc.source = marginReportData;
adg.dataProvider = gc;
gc.refresh();
adg.dataProvider.sort = new Sort();
adg.dataProvider.sort.fields = [new SortField("mr1empclass", true, false),
new SortField("mr1branchid", true, false)];
adg.dataProvider.refresh();
adg.validateNow();
adg.expandAll();
}
"gc" is defined in the MXML. "mr1branchid" is the detail data that appears
when you expand all the parent nodes. The problem is, when I get the
"mr1empclass" field to sort correctly, "mr1branchid" gets out of order and when
I get "mr1branchid" to sort correctly, "mr1empclass" gets out of order. It's
the craziest thing I've ever seen and I've been working on this problem for a
week now. Any insight would be appreciated.
Thank You,
M. McConnell
ANSCORP Guest



Reply With Quote

