1 Reply Latest reply on Feb 17, 2007 10:02 PM by Steven_D._Marshall

    filtering data

      I would like to add a slider to my data grid that limits on the date field. So for example the default would be the last 30 days but you could slide all the way down to only the current day.

      I guess my question is this. Is there anyway to filter results that are returned in an xml file and then put those results into a datagrid? or do I need to query the mysql database again from my php code? which method is faster and if I do have to query again how do I pass a variable to my php code?
        • 1. Re: filtering data
          The easiest way I can think of to accomplish what you want is to use e4x to parse the XML into a collection (this is essentially a one-liner if you use the HTTPService class), then use the filterFunction property on the collection (along with refresh()) to change the values your DataGrid sees (through binding to the collection). Although I haven't timed it and it depends on your network/server but I would be very surprised if the Flex collection/filter approach wasn't many times faster than a PHP/mysql roundtrip, as fast as such is.