2 Replies Latest reply on Apr 23, 2014 3:10 PM by SteveMartino

    Using 'type ahead' to jump to the correct record in list view.

    SteveMartino

      Title

      Using 'type ahead' to jump to the correct record in list view.

      Post

           Hello Forum, especially Phil.  I was trying to replicate something I have in QuickBooks.  Basically, its a customer list (list view).  When you start typing the record indicator moves to the appropriate record.  For example, if I type 'm a r' fairly quickly, the record indicator (highlights) the records that start with 'm', then 'ma', then 'mar'.

           I've searched 'type ahead' here and almost everywhere and cant seem to find what I'm looking for.  I don't want to Enter Find Mode, change the sort order or change the found set.

           Just wondering if this is possible, and if anyone can point me in the right direction.

           Thanks

           Steve

           P.S.  Bit by the 'disappearing post' bug on this post

        • 1. Re: Using 'type ahead' to jump to the correct record in list view.
          philmodjunk

               If your records are sorted by the name field that you describe, try combining the OnLayoutKeystroke trigger with the get ( TriggerKeystroke) function and a binary search algorithm to set the first record that starts with the same text as the current record. A conditional format can highlight the set of matching records and a global variable can store the keystrokes.

               If you aren't comfortable with setting up a binary search algorithm, a simpler method is just to loop through the records from first to last, stopping on the first record that matches. A binary search algorithm just does it in much fewer numbers of loops.

               PS: Due to a noxious forum bug, please protect yourself with a "Select-All, copy to your clipboard" action just before submitting a private message or comment to this forum. The bug can lose your comment and log you out of the forum--forcing you to sign back in and re-enter the comment or message. By copying to the clipboard before posting, you can re-enter your message by pasting from the clipboard instead of having to retype it all over again.

          • 2. Re: Using 'type ahead' to jump to the correct record in list view.
            SteveMartino

                 Thanks for your response Phil.  I always appreciate your detailed explanation, but its beyond my limited experience.

                  I did find a solution here:

            http://www.1-more-thing.com/10-Techniques-for-FileMaker-10.html

                 that works.  I have to go back to work and will finish up with it tomorrow (I have a few quirks I will post about looking for some more advice).

                 I do use the "Select All" to thwart the 'bug' usually....but then I get a little lax, and forget, and that's when it hits me.surprise

                 Thanks again Phil

                 Steve