[flexcoders] datagrid column sorting
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?
[flexcoders] datagrid column sorting
Hi, When you sort columns in a datagrid, I assume that data in a column is sorted according to its natural sorting order (whatever that may be). In my case it's a string. For some reason, the sorting on this column behaves differently. I have data that begins with uppercase and lowercase letters, and columns that are just blank. When I sort on this column I get uppercase, blank, and lowercase (and vice versa when sorting in the reverse order). I'm expecting the sort to be uppercase, lowercase, and blank (and vice versa). Is anyone aware of such a behavior? It's hard for me to pinpoint because I don't have this behavior on my local build, but it's there in a staging build. Thanks, George Yahoo! Groups Sponsor ~-- Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/nhFolB/TM ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] datagrid column sorting
The sorting relies on ASCII values. In the ASCII table Uppercase comes before lowercase. If you need something beyond this, youll have to write the sorting logic yourself and update the dataProvider accordingly. HTH, Jason __ Jason Weiss Cynergy Systems, Inc. Macromedia Flex Alliance Partner http://www.cynergysystems.com Email: jasonDOTweissATcynergysystemsDOTcom __nospam Office: 866-CYNERGY From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of george_lui Sent: Wednesday, November 30, 2005 4:50 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] datagrid column sorting Hi, When you sort columns in a datagrid, I assume that data in a column is sorted according to its natural sorting order (whatever that may be). In my case it's a string. For some reason, the sorting on this column behaves differently. I have data that begins with uppercase and lowercase letters, and columns that are just blank. When I sort on this column I get uppercase, blank, and lowercase (and vice versa when sorting in the reverse order). I'm expecting the sort to be uppercase, lowercase, and blank (and vice versa). Is anyone aware of such a behavior? It's hard for me to pinpoint because I don't have this behavior on my local build, but it's there in a staging build. Thanks, George -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.