A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Force DataGrid Sort (Alphabetize after adding items)

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Posts
    24

    Question Force DataGrid Sort (Alphabetize after adding items)

    Hey all!

    I have a DataGrid set up and have the XML data nice and cozy inside of it, but I have a bit of a snag...

    The data I'm importing comes from a few separate files but the DataGrid ends up displaying all of them, so the rows are a bit of a jumble initially.

    Is there a way to tell the DataGrid, AFTER it has all of it's data, to sort itself out alphabetically based on it's first column?

    Thanks!

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I don't understand what you mean. When you have xml then only one file should be the datafile.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Junior Member
    Join Date
    Feb 2008
    Posts
    24
    The original data file is over 1100 items long. Editing an XML file that big is a massive pain so I broke it down into smaller chunks for sanity's sake.

    The XML works fine. I'm just trying to find out how to force the DataGrid to sort after it's populated.

    When I click on the first column's header, it sorts exactly as I need. Now I need to have it do that automatically so the user doesn't have to.

  4. #4
    Junior Member
    Join Date
    May 2011
    Posts
    1
    Old question, but for anyone looking for answer:

    yourGrid.sortItemsOn("columnName", Array.DESCENDING);

    For example.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center