IMO, it is a bug if setting sort=null and calling refresh() doesn't clear the sort arrows.
Try manipulating datagrid.columnHeaderGroup.visibleSortIndicatorIndices. On 5/2/13 8:55 AM, "[email protected]" <[email protected]> wrote: > Thanks Om, Unfortunately my datagrid is extremely complicated, and replacing > it with lists won't accomplish the same thing. > > ----- Original Message ----- > From: "OmPrakash Muppirala" <[email protected]> > To: [email protected] > Sent: Thursday, May 2, 2013 8:39:20 AM > Subject: Re: programmatic sort for Spark datagrid, accounting for sort > triangle state > > I don't know how complex your datagrid needs to be, but consider this if it > is not too complex: > > If it is a two column datagrid, perhaps it would be better to draw two > lists side by side with the same dataprovider pointing to the different > fields. > > It is a little more work to get the sort buttons working, but you will have > much more control over things. > > Thanks, > Om > On May 2, 2013 8:11 AM, <[email protected]> wrote: > >> I also tried: >> >> private function redrawGrid():void { >> groupId.removeElement(myGrid); >> callLater(redrawGridLater); >> } >> >> private function redrawGridLater():void { >> groupId.addElement(myGrid); >> } >> >> but same problem ... the sort arrow is still displayed. >> >> Is there some way to wipe myGrid out of memory (or some other idea), then >> create it again (from scratch)? >> >> >> ----- Original Message ----- >> From: [email protected] >> To: [email protected] >> Sent: Thursday, May 2, 2013 7:56:12 AM >> Subject: Re: programmatic sort for Spark datagrid, accounting for sort >> triangle state >> >> Correct, it does not work. More specifically, if I use: >> >> private function redrawGrid():void { >> arrCol.sort=null; >> arrCol.refresh(); >> } >> >> the sort correctly resets, but the sort arrow is not updated or changed in >> any way. >> >> ----- Original Message ----- >> From: "Tom Chiverton" <[email protected]> >> To: [email protected] >> Sent: Thursday, May 2, 2013 7:48:00 AM >> Subject: Re: programmatic sort for Spark datagrid, accounting for sort >> triangle state >> >> On 02/05/2013 15:44, [email protected] wrote: >>> The thinking is, when the datagrid is first drawn, there is no sort >> arrow displayed, even though the first column is sorted by default. How do >> I get back to this scenario AFTER the datagrid is first drawn? >> Does removing the Sort from the underlying dataProvider not work ? >> >> Tom >> -- Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui
