Alpha Video Training
Results 1 to 2 of 2

Thread: Modify grid search component

  1. #1
    Member
    Real Name
    Chris
    Join Date
    Jun 2007
    Posts
    4

    Default Modify grid search component

    I need to be able to perform queries on data presented by my grid component, so I'm using the built-in search. However I need to be able to perform "OR" and "AND" queries to match two sets of rows meeting two independent sets of criteria. For example, the search feature lets me search for all rows where Gender = 'Male' and Disease = 'Adenocarcinoma', but I also need to be able to search for rows where Gender = 'Male' and Disease = 'Adenocarcinoma' OR Gender = 'Female' and Disease = 'Pancreatitis'.

    Is the search portion of the grid component modifiable to this extent, or will I have to use some XBasic to make this work. If the latter, I'd appreciate it if someone can point me at the best starting point.

    Thanks,

    -Chris

  2. #2
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: Modify grid search component

    Although I think you could pull it off using calculated fields, probably the best way is to create an input form using a dialog component that requests those various search fields. Then construct a URL in the AfterValidate event that opened a second page containing a grid. The URL would need to include Alpha's unique method to filter and order the results from a URL. Find that in the Help documentation, its pretty clear. You could even include logic such as OR and AND.

    The resulting URL might look like this:

    DiseaseInfo.A5w?customers_filter=gender="{sex1}" .and. disease="{disease1}" .or. gender="{sex2}" .and. disease="{disease2}"

    where the variables in {} get replaced at runtime from your dialog fields. What I'm not sure about is if the above query properly combines the two AND's before the one OR. You may have to expirement.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

Similar Threads

  1. Grid Component Search on SQL Server Logical field
    By ldconsultants in forum Application Server Version 8
    Replies: 2
    Last Post: 06-14-2007, 05:15 PM
  2. More web component search options
    By Nathan Zeiset in forum Archived Wishlist
    Replies: 0
    Last Post: 04-05-2007, 01:38 PM
  3. Highlighting Search String in Grid Search
    By acidcigarfiend in forum Web Application Server v7
    Replies: 16
    Last Post: 03-03-2006, 01:12 AM
  4. Search and Grid - Horizontal layout in web component
    By chandran in forum Web Application Server v7
    Replies: 2
    Last Post: 01-03-2006, 12:29 PM
  5. Grid component search part?
    By David Brown in forum Web Application Server v6
    Replies: 1
    Last Post: 06-01-2005, 07:43 PM

Bookmarks

Posting Permissions

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