1 Reply Latest reply on Jan 20, 2008 10:22 PM by Sreenivas R

    How can i filter an XML by selectedRanges from a datechooser

    NicholasKoji
      Hello,
      I am new to Flex and i was wondering how i would go about filtering an XML with a list of dates from a selectedRanges array. The array is under dateselect.selectedRanges. I would like to create a new array with all the dates that the user has selected and figure out the prices of the rooms and which rooms are actually open. I assume to get this i need to filter out the dates they selected first. If not please let me know of another way to approach this.
      My Code:
      http://pastebin.com/m6cd9c3b3

      My XML:
      http://www.allaboutthekick.com/flex/php/availability.php
      you must view source to see the full XML
        • 1. Re: How can i filter an XML by selectedRanges from a datechooser
          Sreenivas R Adobe Employee
          If you are using e4x as the result format for your service you can do the following

          //a XMLList of all day information
          var result:Object = event.result.day;

          //consits all information for month zero
          var month0:XMLList = result.(@month == 0);

          //consists of booking info for day 28 of month 0
          var day28Month0:XMLList = month0.(@day == 28);

          //this also can be done
          //contains booking info for all months for day 28
          var day28AllMonths:XMLList = result.(@day == 28);

          Using this technique you should be able to gather info about all user selected dates and build the smaller (filtered) list.

          HTH