Sorting a DataGrid without changing the content

I have a datagrid which is shown in a chart. I'd like to have it sorted upside down the dataField "x" without changing the chart, which is bound to the same arrayCollection. How can I do this without changing the chart?
<mx:DataGrid sortableColumns="false"  width="480" height="156" dataProvider="{myArrayCollection}" editable="false" y="581" enabled="true" x="10">
          <mx:columns>
                <mx:DataGridColumn id="col1" dataField="x" headerText="Trade #" />
                <mx:DataGridColumn id="col2" dataField="p" headerText="Price" />
                <mx:DataGridColumn id="col3" dataField="n" headerText="Users" />
            </mx:columns>
</mx:DataGrid>
thanks
nicolas

ArrayCollection is a view of a source Array.  If you create a second view, it can have a different sort order because sort and filters are properties of a view.
Just assigning AC2 = AC1 simply has AC2 referencing the same view so sorting will have an effect on all consumers of that view.  However, if you do:
AC2 = new ArrayCollection();
AC2.list = AC1.list
then you can sort AC2 and AC1 will not reflect the sort and vice-versa.  But, if you add an item to AC2 or AC1 it will be reflected in the other AC.  If you modify a property of an item in one AC, the other AC will see it.
If you do:
AC2 = new ArrayCollection()
AC2.source = AC1.source
You can also sort AC2 and AC1 will not reflect the sort and vice-versa.  But, if you add an item to AC2 or AC1, the other will not reflect that change unless you force an update on the other.  Same is true if you modify a property on an item in the AC.  The other AC won't know about it until you force an update.
If you want to modify properties of an item in one AC and not every have it reflected in the other AC, then you should do a copy as the previous responder suggested.  I believe you want to use the pattern that assings AC2.list = AC1.list.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

Similar Messages

  • How can I control the display of rows in datagrid without changing the dataprovider?

    Hello,
    I'm using advancedatagrid to render my table but I'm facing a problem to skip few rows which are unwanted or to hide. I should retain my original dataprovider without any modifications to achive this behaviour as I'm using it at many places.
    Can you guys please send me a tip or the example code? I really appreciate for it.
    Thanks,
    Siva.

    Hello Gaurav,
    Thank You..!!! I tried appling filterFunction on the ADG and got whatever I expected but filter changes the original dataprovider behaviour. SO which I dont want to do it.
    I have created a local variable and binded whatever data wanted to display on that page. Infact it works as expexted and I still have original data provider as well.
    I have one more problem, I'm using creationComplete to initialize my local data provider value. It works only once while creation of state. If I navigate my screens fore and back and come back to this screen, it doesn't display the modified values as creationComplete loads only while state creation.
    Is there any mothid which does the samething while vising the page every time than creation?
    Thanks,
    Siva

  • I have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code?

    i have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code? thank you!

    i inherited the website. It’s for a non-profit and is not very
    sophisticated, and neither am I in webdesign. It currently has multiple
    pages that are identical except for that body section, so whenever i change
    the navigation (in the sidebar) I have to update every html page.  I want
    to have one basic page, and just call in the different body content based
    on the link the user selects from the nav bar. How can i do that using a
    script? i am using Dreamweaver.
    ~ in love and light ~
    Jeannie
    On Sat, Feb 7, 2015 at 4:07 AM, Ben Pleysier <[email protected]>

  • After setting up my new 4S restoring a backup of my old one, I've renamed the old 3GS in iTunes and changed the content, deleting all my important stuff. Now I'm syncing the old one to my PC. Can I then backup my NEW 4S to  iCloud without messing up all-?

    After setting up my new 4S, restoring a backup of my old 3GS, I've renamed the old 3GS in iTunes and then I've changed the content, deleting all my important stuff. Now I'm syncing the old one to my PC. Can I then after that safely backup my NEW 4S - which now holds all my company information and stuff - to  iCloud without risking to lose it?

    Hi Mcchen425,
    Welcome to the Support Communities!
    As a precaution, I would suggest backing up your iPhone to your computer via iTunes as well as iCloud.  Then you can delete one of your two backups.  The article below will explain all of your options for deleting data or backups from your iCloud storage.
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/ht1766
    iCloud: Managing your iCloud storage
    http://support.apple.com/kb/ht4847
    Cheers,
    - Judy

  • How can I change the year of an album in itunes11 without changing the years of all titles?

    How can I change the year of an album in itunes11 without changing the years of all titles. For example: the reissues of an 1982 album has a 1995 bonus track, but I want it to be sorted as an '82 album? In earlier versions, when itunes sorted my album "by year", it took the year of the first title as the album's year (which makes a lot of sense). In itunes 11, however, the /highest/ year of any title in an album is taken to be the album's year. This upsets my entire catalogue. Can this be changed, will this be changed?

    Highlight all of the songs,File>Get Info, change the genre

  • Big Permissions Problem: "You Cannot Change The Contents Of This Folder"

    I installed Tiger some time ago (and need to upgrade now from 10.4.6 to 10.4.9).
    I haven't used it much since some of my software will only run under Panther.
    In any case, I'm using it now and have been having big permissions/user accounts problems.
    I have two users on the computer "robert" and "ra", both with admin privileges (I set up two because I was trying to get around these problems -- I'd be very happy with just one).
    I have 10.4.6 installed on an external HD and boot from that into Tiger (I have Tiger on another external HD as a backup, and my main HD in the iMac has 10.3.9 -- that's what I boot from when I need to run older programs).
    In any case, both "robert" and "ra" have ADMIN privileges. But I get weird ownership problems. For instance, if I am logged in as "ra" and try to play a Realplayer file streaming from the web (in Firefox 1.x), I get the error
    /Users/robert/Desktop/307e6wz7 could not be saved, because you cannot change the contents of that folder.
    I check the ownership of the "Desktop" folder -- read/write for "ra".
    If I right-click I can save the Realplayer file to the desktop.
    Same with other links.
    I've also noticed other ownership problems (blocked folders at finder level) but can't duplicate tonight. Is this an obscure error, or is there something amiss in ownership recognition? Is there some way I can sort all out? Login in as "root" and set all right?
    Thanks
    G4 iMac   Mac OS X (10.4.6)  

    Yes they do. When you installed them you dragged these particular apps to the Applications folder. Doing so automatically attributes the program with the ownership attributes of the account owner who installed them - 'robert.'
    Proper application installers install apps under the system/admin ownership. You can try to fix these apps by changing their permissions:
    Select the app and CTRL-click to open the contextual menu. Choose Show Package Contents from the contextual menu. Select the Contents folder and press COMMAND-I to open the Get Info window. In the Ownership and Permissions section click on the tiny arrow icon to expose the panel. Click on the little lock icon to authenticate. Change permissions as follows:
    Owner = system with Read/Write privileges
    Group = admin with Read/Write privileges
    Other with Read-Only privileges
    Click on the Apply To Enclosed Items button. Close the lock by clicking again on the lock icon.

  • Is waiting for the application to change the content ???

    Many methods online, but I have tried many without success, is still stuck in this "is waiting for the application to change the content does not respond.

    See:
    iOS: Troubleshooting applications purchased from the App Store
    Contact the developer/go to their support site
    Restore from backup. See:
    iOS: How to back up
    Restore to factory settings/new iPod

  • How can I change the password in the iBook donated to our nonprofit.  No password was given with the iBook?  We need to put in printer and other software.  Help, we can use the laptop without changing the password.

      How can we change the password in the iBook donated to our nonprofit?  No password was given with the iBook and every time we try to install items, the password window pops up.  We need to put in printer and other software.  Help! We can use the laptop without changing the password.

    If you did not get an OS X install-restore DVD with the computer you may need
    to buy one from somewhere, and you may be lucky to get a retail OS X 10.5.x
    version. The original grey-label install set of software and OS X it shipped with
    likely would be an older system than Leopard 10.5. Last versions of G4 Mac, &
    G5, shipped with a Tiger 10.4 system; so did early Intel-based Mac. Grey discs
    which accompanied other computer build models generally do not interchange.
    The last OS X version a PowerPC architecture can use, if supported, is 10.5.8.
    A PPC processor at 867MHz & faster should be able to run OS X 10.5 Leopard.
    {With the correct disc installer, you can use it to change a password and other
    things including re-install, and perform disk utility functions, etc.}
    There is a chance you may be able to get a white-label Replacement 10.4 DVD
    or Replacement 10.5 DVD from AppleCare or the online Apple Store (800myapple)
    from a Mac OS X system specialist; these have been available yet hard to get
    as not all persons involved with them seem to know if they still exist until someone
    is asking. These aren't retail stock, are special discs for computers who could use
    a system later than original old discs; these are complete install discs not for one
    specific series of Mac. Generally they'd work in supported PowerPC G4/G5; but
    do not replace specialized original install DVD, such as an early Intel mac requires.
    You'd need to have a serial number of the computer, and a method of payment
    when seeking some replacement system media from Applecare or Apple sales
    and these discs are not available in a retail store. The original Retail discs are
    labeled differently and shipped in a retail box with a big X on the front. Other
    sources for retail 10.4 Tiger or 10.5 Leopard may be online via amazon sellers
    or computer resellers who handle repaired Macs. Avoid mystery grey label ones
    that were intended to be sold and kept with their original computer kits.
    Good luck!

  • After upgrading to Maverick, when I double click on the attchment I get this message "...could not be saved, because you cannot change the contents of that fold

    After upgrading to Maverick, when I double click on the attachment I get this message "...could not be saved, because you cannot change the contents of that folder. Change the folder properties and try again, or try saving in a different location." It happens for all types of files.
    Any suggestions as how to fix this?
    I'm on a Mac OS X 10.9.3 with Thunderbird 24.5.0

    Thunderbird > preferences (I think on a mac) and under attachments set the folder

  • Change the background color of a particular word without changing the background color of the rest of the text in a textbox

    Hello,
    I'm designing my own website and want to know how to change the background color of a particular word without changing the background color of the rest of the text in a textbox. If i can't do this, how can I create a Table, similar to Excel with iWeb?
    Thank you very much!
    Roger.

    If i can't do this, how can I create a Table, similar to Excel with iWeb?
    Read this :
         Create and add a TABLE in iWeb »
         More about a TABLE in iWeb »
         Sample 1
         Sample 2

  • Firefox crashes whenever i want to install any addon or download any file. Some times i am receiving error while downloading any file like "could not be saved, because you cannot change the contents of that folder"

    I am the user of latest firefox 3.6.6 browser. I am getting problems of frequent crashes whenever i tries to install any addon. The crashes also occures whenever i want to download any file.
    I am also receiving errors while downloading any file like:
    "C:\Users\****\AppData\Local\Temp\******.001.part could not be saved, because you cannot change the contents of that folder.
    Change the folder properties and try again, or try saving in a different location. I already changed it many many times but still the same problem."
    Adobe flash palyer is also giving problems of not responding. I am using updated version of it already. Java is also updated.
    I already uninstalled firefox compeletly and re installed it many many times but still the same problem. I also scanned my computer with avira and malware bytes' Anti malware and got no dection. Please ractify this problem ASAP lest my profession will suffer.
    == Crash ID(s) ==
    b7f518f2-8d86-41ca-8bab-aee632100709; 1d790e10-d8eb-4904-98c9-94bc62100708; f042d319-b9f8-42ed-a8cb-57c7d2100708

    Please help.
    It is getting worse
    Adobe flash player is crashing. I already uninstalled and re installed the latest ver. Also it is hanging randomly.
    Please help.

  • When firefox trys to auto update, or I manually download the new version, or some but not all downloads off of the web, I get this error message. C:\Users\John\AppData\Local\Temp could not be saved, because you cannot change the contents of that folder.

    First off, when firefox trys to auto update, it fails. It tells me to try and download the new version from mozilla's site. When I try to download the new version I get this: (C:\Users\John\AppData\Local\Temp could not be saved, because you cannot change the contents of that folder.)
    This is the same message I have been getting when I try to download other things off the net. (When I use other browsers to download I dont have this problem)

    Please help.
    It is getting worse
    Adobe flash player is crashing. I already uninstalled and re installed the latest ver. Also it is hanging randomly.
    Please help.

  • Is it possible to copy and paste a formula without changing the cell references?

    I am trying to paste a formula to a cell adjacent to where it currently is but when I do, the cell references in it change. I am trying to get exactly the same formula in the cell (without re-typing it).

    dedwards96 wrote:
    Just another quick question, is it possible to make a large number of cell references 'absolute'?
    Individual cell references in formulas may have four distinct states: relative, absolute column, absolute row, or absolute column and row. These are set using the popup menu on the reference itself. Click on the reference in the formula and choose one of the four states from the popup menu.
    Once set, you can fill the formula into the rest of a column or row using the Fill Handle (small circle at the lower right of a selected cell). Cell references in the new copies of the formula will remain absolute or adjst to their new position dependent on the setting for each reference. You can also copy and paste the cell (single click to select it, command-C to copy) with the same results.
    You can also copy/paste without changing the formula's cell references if you select the formula (Drag across the formula in the entry bar, copy, press tab to deselect and reconfirm the formula in the original cell) rather than the cell. Pasted into a new cell, the formula will appear as if you typed it in exactly as it was in the original cell—neither absolute references nor relative references will have changed.
    Regards,
    Barry

  • How to change the content of GTC (terms and conditions) for Partner

    Hi all,
         We are using R/3 version of ISA B2B site. while creating order thru Shopping Basket we have requirement that We need to provide GTC (General Terms and Condions) for the Partner (View GTC link ).  Right now some default text is displayed in that window (text text text ext text text text text text like that). we need to change this.
    where i can change this text and enter our own terms and conditions.
    Please help me to resolve this,
    thanks in advance
    siva kumar

    Hi Siva,
    the GTC is shown in the JSP b2c/order/terms_and_conditions.jsp. If you have a look at the file, you will find the following code:
    <isa:translate key="b2c.order.termsAndConds.txt.dmy"/>
    The translate tag will render the language dependant text for the resource key "b2c.order.termsAndConds.txt.dmy". To change the content that is shown you can change the resource text or create your own resource key in the corresponding resource file. The resource files are located in the src-folder of the web application DC.
    Best Regards,
    Peter Kraus
    SAP Web Channel Consultant
    http://www.leonardo-it.com

  • Changing the Content of a Document at creation time using Java

    Hi,
    I made a ClassObject 'Division' that is a subclass of the
    oracle.ifs.beans.Document,
    and I want to change the content of a Division instance while it
    is being created because I can't change the editor (Epic) that
    creates this object.
    (and it has to be at creation time!)
    To do this, I made a server-side class S_Division that
    implements the extendedPreUpdate method.
    I was able to get the content of the object when that method was
    called for the 4th time
    and that way I could change some attributes of that object that
    depend on that content.
    My problem is that I need to change the origal content into
    something else using that extendedPreUpdate method
    and I don't know how.
    The bean-side Document class has an easy method setContent
    (DocumentDefinition) for changing the content of its instances,
    but the server-side S_Document doesn't!
    So how can I do that using the server-side classes?
    Maybe using the update(OperationState,
    S_LibraryObjectDefinition) method?
    Can someone give me some help or an example that shows me the
    way?
    Thanx,
    Gerd Vanhoof

    Hi,
    I made a ClassObject 'Division' that is a subclass of the
    oracle.ifs.beans.Document,
    and I want to change the content of a Division instance while it
    is being created because I can't change the editor (Epic) that
    creates this object.
    (and it has to be at creation time!)
    To do this, I made a server-side class S_Division that
    implements the extendedPreUpdate method.
    I was able to get the content of the object when that method was
    called for the 4th time
    and that way I could change some attributes of that object that
    depend on that content.
    My problem is that I need to change the origal content into
    something else using that extendedPreUpdate method
    and I don't know how.
    The bean-side Document class has an easy method setContent
    (DocumentDefinition) for changing the content of its instances,
    but the server-side S_Document doesn't!
    So how can I do that using the server-side classes?
    Maybe using the update(OperationState,
    S_LibraryObjectDefinition) method?
    Can someone give me some help or an example that shows me the
    way?
    Thanx,
    Gerd Vanhoof

Maybe you are looking for