3 Replies Latest reply on Oct 25, 2011 11:24 PM by Flex harUI

    Filtering datagrid with textInput?

    xandout

      I have a datagrid that is populated from MySQL, I would like to have a "search" box on the page that will filter based on input.

       

      An example in Flash is here: http://www.adobe.com/devnet/flash/quickstart/datagrid_pt3.html

       

      The example there is instant, I do not really need instant. If it needs to be done with an onClick button event, that is fine.

       

      I have read through several web pages and forum posts here and have yet to find anything that I could understand.  Any help is welcome, links, code snippets, even just plain old advice.

       

      I really appreciate in advance guys.

        • 1. Re: Filtering datagrid with textInput?
          Flex harUI Adobe Employee

          Look for examples on using filterFunction in ArrayCollection.

           

          If you want a TextInput in the header, that is more challenging, but there should be examples out there.

          1 person found this helpful
          • 2. Re: Filtering datagrid with textInput?
            xandout Level 1

            OK What I had done before I saw this reply was create a copy of the getAllCustomer() function and changed this:

            $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename");

            to this:

            $stmt = mysqli_prepare($this->connection, "SELECT * FROM customer WHERE customer.company LIKE '%$search%'");

            And with a button I call this:

            getAllCustomerResult.token = customerService.getAllCustomerSearch(custSearchText.text);

             

             

            I know this is creating a lot of overhead for my server as it is another flex ->  PHP -> MySQL call.

             

            I know this can be acheived without this and I did see references to this ArrayCollecton elsewhere I was just clueless on how to do this.

             

            Can you provide a link to an easy to follow article on this.

             

            Thanks a ton though.

            • 3. Re: Filtering datagrid with textInput?
              Flex harUI Adobe Employee

              Just google for “flex examples arrayCollection filter”