[flexcoders] Re: DataGrid sort
thank Alex But, i see the stack execution, but the sort function is throw by de arralListView, and i am not delete this execution. any another solution? thank --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: I would set a breakpoint on your sortable function so you can see who is calling it again. It should not be called when you select a row. Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of mhbmarcos Sent: Wednesday, May 20, 2009 9:13 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] DataGrid sort Hi!!, i have a problem with dataGrid the dataGrid have into dataGridColumn a sortable function, so if sort this column, sort correct, but if then i have select any row, againt execute the sortableColumn. Please, solution for this? how to remove sortable function? thanks
RE: [flexcoders] Re: DataGrid sort
Post the stacktrace. Use a debug build so you get line numbers Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of mhbmarcos Sent: Wednesday, May 20, 2009 10:56 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: DataGrid sort thank Alex But, i see the stack execution, but the sort function is throw by de arralListView, and i am not delete this execution. any another solution? thank --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aha...@... wrote: I would set a breakpoint on your sortable function so you can see who is calling it again. It should not be called when you select a row. Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of mhbmarcos Sent: Wednesday, May 20, 2009 9:13 AM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] DataGrid sort Hi!!, i have a problem with dataGrid the dataGrid have into dataGridColumn a sortable function, so if sort this column, sort correct, but if then i have select any row, againt execute the sortableColumn. Please, solution for this? how to remove sortable function? thanks
RE: [flexcoders] Re: Datagrid - Sort Error
I think the error you are getting is because not all objects/nodes contain a date attribute. Normally, the sort code checks the first item to see if it has the sortField. That's probably why it works sometimes for you, depending on what the first node is. When you use a custom compare function, the Sort code doesn't check to see whether the sortFIeld exists From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sleblang Sent: Friday, September 05, 2008 9:03 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Datagrid - Sort Error Thanks. However, I looked at the code and it looks basically the same as mine with the only noticeable difference being the compare function. Is the compare function necessary if I am only sorting by one column (Date)? Thanks. --- In flexcoders@yahoogroups.com, Igor Costa [EMAIL PROTECTED] wrote: Try This. http://blog.flexexamples.com/2008/04/09/creating-a-custom-sort-on-a-datagrid-control-in-flex/ It will help you. Regards Igor Costa www.igorcosta.org On Fri, Sep 5, 2008 at 7:53 PM, sleblang [EMAIL PROTECTED] wrote: I am getting the following error when attempting to run a sort on a datagrid's dataprovider (which is an XMLListCollection). It doesn't occur the first time I r! un the sort, however all subsequent runs result in an error: Error: Find criteria must contain at least one sort field value Here is the sort code: // sort on date var sortA:Sort = new Sort(); var sortByDate:SortField = new SortField(@date,false,false) sortA.fields=[sortByDate]; // Refresh the collection view to show the sort. modelLocator.projectData.projectData_xlc.sort = sortA; modelLocator.projectData.projectData_xlc.refresh(); Any ideas as to where the error might be? Thanks for any and all replies. -- Igor Co! sta www.igorcosta.com www.igorcosta.! org gt;
[flexcoders] Re: Datagrid - Sort Error
Thanks. However, I looked at the code and it looks basically the same as mine with the only noticeable difference being the compare function. Is the compare function necessary if I am only sorting by one column (Date)? Thanks. --- In flexcoders@yahoogroups.com, Igor Costa [EMAIL PROTECTED] wrote: Try This. http://blog.flexexamples.com/2008/04/09/creating-a-custom-sort-on-a-data\ grid-control-in-flex/ It will help you. Regards Igor Costa www.igorcosta.org On Fri, Sep 5, 2008 at 7:53 PM, sleblang [EMAIL PROTECTED] wrote: I am getting the following error when attempting to run a sort on a datagrid's dataprovider (which is an XMLListCollection). It doesn't occur the first time I run the sort, however all subsequent runs result in an error: Error: Find criteria must contain at least one sort field value Here is the sort code: // sort on date var sortA:Sort = new Sort(); var sortByDate:SortField = new SortField(@date,false,false) sortA.fields=[sortByDate]; // Refresh the collection view to show the sort. modelLocator.projectData.projectData_xlc.sort = sortA; modelLocator.projectData.projectData_xlc.refresh(); Any ideas as to where the error might be? Thanks for any and all replies. -- Igor Costa www.igorcosta.com www.igorcosta.org
[flexcoders] Re: Datagrid sort order: is there a natsort() such as in PHP?
You have to do a sortCompareFunction, ala mx:DataGridColumn dataField=number sortCompareFunction={sortOnNumber} / and then create something like: private function sortOnNumber( obj1:Object, obj2:Object ):int { if( obj1[number] obj2[number] ) { return -1; } else if( obj1[number] obj2[number] ) { return 1; } else { // They are equal so do another col sort if you want if( obj1[ID] obj2[ID] ) { return -1; } else if( obj1[ID] obj2[ID] ) { return 1; } else { return 0; } } } --- In flexcoders@yahoogroups.com, mr_j_harris [EMAIL PROTECTED] wrote: Datagrid sort order: is there a natsort() such as in PHP? This is sort order on some strings: 1 10 11 2 21 23 This natsort order on the same strings: 1 2 10 11 21 23 In short, it deals sanely with a numeric string suffix. Anything like that in Flash/Flex out-of-the-box? -- John
Re: [flexcoders] Re: DataGrid Sort by Date problem -- Flex 2
On Tuesday 08 Jan 2008, vkc_nair wrote: Any help on this? Did you check the parse() result ? In light of http://rachaelandtom.info/node/1373 I would :-) -- Tom Chiverton Helping to efficiently conquer enterprise-class solutions on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by The Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.com. -- 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/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * 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/
[flexcoders] Re: DataGrid Sort by Date problem -- Flex 2
Any help on this? Thanks --- In flexcoders@yahoogroups.com, vkc_nair [EMAIL PROTECTED] wrote: Hi All, I'm having problem with DataGrid sort by date column. My date value in the XML file is as =Mon Apr 03 15:18:59 PDT 2006. Put the value on DataGrid like mx:DataGridColumn dataField=prechecked headerText=Prechecked sortCompareFunction=date_sortCompareFunc / I have a date compare function as private function date_sortCompareFunc(itemA:Object, itemB:Object):int { var dateA:Date = new Date(Date.parse(itemA.prechecked)); var dateB:Date = new Date(Date.parse(itemB.prechecked)); return ObjectUtil.dateCompare(dateA, dateB); } Sitll I'm not able to get the data sorted correct. What's wrong? Any help? Thanks