1 Reply Latest reply on Jul 13, 2009 3:16 AM by _Natasha_

    how to sort xmllistcollection on subnodes?

    dilbertje Level 1

      greetings!
      i'm trying to sort a xmllistcollection, but it just won't sort in the right order.
      here's an example of my xmllistcollction:

      <Dealer xmlns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <number>104016</number>
      <name>Adams Muziekcentrale NV</name>
      <address>Halensebaan 157</address>
      <postalcode>B-3290</postalcode>
      <city>Diest</city>
      <province>Vlaams-Brabant</province>
      <country>1</country>
      <countryFull>1</countryFull>
      <dealertypeID>4</dealertypeID>
      <dealertypeFull>DLR</dealertypeFull>
      <phone>0032-13-352020</phone>
      <fax>0032-13-352026</fax>
      <email>info@adams-music.be</email>
      <website>www.adams-music.be</website>
      <accountmanager>Quinn Vaessen</accountmanager>
      <contactperson>DHR Rudi Jongen</contactperson>
      <logo/>
      </Dealer>,<Dealer xmlns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <number>104011</number>
      <name>Cam Cole Music</name>
      <address>Oudenaardsestraat 56</address>
      <postalcode>B-9500</postalcode>
      <city>Geraardsbergen</city>
      <province>Oost-Vlaanderen</province>
      <country>1</country>
      <countryFull>1</countryFull>
      <dealertypeID>1</dealertypeID>
      <dealertypeFull>DLR</dealertypeFull>
      <phone>0032-54-412138</phone>
      <fax>geen</fax>
      <email>info@camcole.be</email>
      <website>www.camcole.be</website>
      <accountmanager>Quinn Vaessen</accountmanager>
      <contactperson>DHR Gino Franceus</contactperson>
      <logo/>
      </Dealer>,..... etc etc




      I'm trying to filter them like so:
      var nameSort:Sort = new Sort();
      nameSort.fields = [new SortField('name', true,true,false)];
      dealers.sort = nameSort;
      dealers.refresh();


      He sorts them, but not like it should....
      Can anyone help me out with this one? I've been looking around on the web, millions of examples but none to solve the above

      thanks!