3 Replies Latest reply on Feb 22, 2015 9:51 PM by BruceHerbach

    Controlling Row Position on Screen

    bbringardner

      I have  simple grocery getter app which orders my grocery list based on when I will arrive at the item in the store.  When I press a
      "got it" button a script runs adding a 1 to a "got it" field for that record and then the records are then constrained to records without a 1 and sorted to stay in order based on location. 

      The question I have is, I would like for the list to not move visually on the screen except for one position up after the gotten item is removed.  Unfortunately, when I check off an item and it is removed from my list the list shifts fairly significantly to where I have scroll to get back where I want to be.

      I have setup a script which gets the record and then goes to that record, but I am still seeing the same results. 

      Is there another way to keep the position of the list consistent?

      If you are interested in helping I can send you the FMP file.

       

      Thanks,

      Ben

        • 1. Re: Controlling Row Position on Screen
          BruceHerbach

          Ben

           

          Try adding a few things to your script

           

          Freeze window

          Set variable ($row; get portal row)

           

          Your stuff goes here

           

          Goto object(your portals object name here )

          Goto portal row $row -1)

           

          This should put you back I the same approximate row. Hopefully your portal will not jump much.

           

          HTH

           

          Sent from my mobile device... Please excuse typos.

          • 2. Re: Controlling Row Position on Screen
            erolst

            From your description I gather it would be sufficient to set the flag, then simply omit the record from the found set, rather than performing a Constrain.

            • 3. Re: Controlling Row Position on Screen
              BruceHerbach

              Ben,

               

              Not sure why,  but I was thinking you were using a portal.  After re-reading your description and erolst's comments,  I think he has the right idea for you.

               

              You could add an on modify script trigger to the got it field.

               

              if got it = 1;

              commit record

              omit record

              end if.

               

              if you used a button,  have it set field, commit and omit.

               

              Either way, this should leave you in the same position on the screen and the records below would slide up one.

               

              HTH