Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Toggle sort between ascending and descending

Featured Replies

  • Author

Is this a simple question? I think it ought to be but the answer isn't obvious. I would like to be able to click on a column heading of a list and toggle the sort between ascending and descending. Is this easy to do?

Is this a simple question? I think it ought to be but the answer isn't obvious. I would like to be able to click on a column heading of a list and toggle the sort between ascending and descending. Is this easy to do?

The Table View will let you do this. You need to first set this option in Layout Mode, the Views Options in Layout Mode. (Layout Mode >> Layouts >> Layout Setup >> Views >> Table View >> Properties and the click the Sort Data when selecting column.

HTH

Lee

cool.gif

The Table View will let you do this. You need to first set this option in Layout Mode, the Views Options in Layout Mode. (Layout Mode >> Layouts >> Layout Setup >> Views >> Table View >> Properties and the click the Sort Data when selecting column.

HTH

Lee

cool.gif

  • Author

As far as I can see this only allows me to specify that I want to sort on a column. Where can I say that I want to toggle between ascending and descending? I can choose ascending/descending or custom ... but I haven't found out where to specify toggle. Am I missing something?

  • Author

As far as I can see this only allows me to specify that I want to sort on a column. Where can I say that I want to toggle between ascending and descending? I can choose ascending/descending or custom ... but I haven't found out where to specify toggle. Am I missing something?

Just click again.

Just click again.

  • Author

Clicking again just invokes the same sort direction ... there is no mechanism that I have seen to specify that if you click again that it will change sort direction. Where is that specified?

  • Author

Clicking again just invokes the same sort direction ... there is no mechanism that I have seen to specify that if you click again that it will change sort direction. Where is that specified?

That's weird, I have exactly the same setup and it works for me. Are you sure you are viewing in Table View?

What version of 7 are you using. What version of OS 10 are you using (i.e. 10.2.x)

HTH

Lee cool.gif

That's weird, I have exactly the same setup and it works for me. Are you sure you are viewing in Table View?

What version of 7 are you using. What version of OS 10 are you using (i.e. 10.2.x)

HTH

Lee cool.gif

  • Author

Forgive my lack of comprehension. I'm working on an existing layout, and the sort is invoked by a script. That is what I want to change. However, I did try to test it by specifying it as part of the table view ... although I'm not absolutely sure how I can determine the difference between a list and a table. Anyway, I removed the script from the column heading and added the sort to the properties, but it did not APPEAR to do anything.

  • Author

Forgive my lack of comprehension. I'm working on an existing layout, and the sort is invoked by a script. That is what I want to change. However, I did try to test it by specifying it as part of the table view ... although I'm not absolutely sure how I can determine the difference between a list and a table. Anyway, I removed the script from the column heading and added the sort to the properties, but it did not APPEAR to do anything.

Now it sounds like you have a button with sort attached? This is not a button created by you. the View "Table" provides its own buttons using the field names as buttons.

If this is confusing you, attach a striped down sample of your files so we can be sure we are talking apples to apples and not apples to oranges.

Lee

cool.gif

Now it sounds like you have a button with sort attached? This is not a button created by you. the View "Table" provides its own buttons using the field names as buttons.

If this is confusing you, attach a striped down sample of your files so we can be sure we are talking apples to apples and not apples to oranges.

Lee

cool.gif

Why not set a global when you run your sort scripts, and then branch based on what's in the global?


If [ gLastSort = "Name Ascending" ]

  Sort [ Restore ; by Name (Descending) ]

  Set Field [ gLastSort ; "Name Descending" ]

Else

  Sort [ Restore ; by Name (Ascending) ]

  Set Field [ gLastSort ; "Name Ascending" ]

End If

This could be used in conjunction with script parameters to use one sort script for several buttons.

Why not set a global when you run your sort scripts, and then branch based on what's in the global?


If [ gLastSort = "Name Ascending" ]

  Sort [ Restore ; by Name (Descending) ]

  Set Field [ gLastSort ; "Name Descending" ]

Else

  Sort [ Restore ; by Name (Ascending) ]

  Set Field [ gLastSort ; "Name Ascending" ]

End If

This could be used in conjunction with script parameters to use one sort script for several buttons.

attach a copy of your file. First strip out any and all confidential data. we really only need an No Records copy to see what the problem is

  • Author

Will it make any difference if I have separated the UI and data altogether ... do you want me to send an empty data file too?

(Sorry for the delay in responding to earlier suggestions but I have been struggling with a problem that now appears to be related to a change in behavior of go to related record)

Hi PWarwick,

We should only need an empty file, but if you do send one with some data, be sure that you have striped out any confidential information.

Lee

  • Author

I created a stripped down version of the file. I've only included one layout ... the one with the sort ... and I've left all of the scripts. But how do I attach it ... I tried and got informed that it was the wrong type of file for an attachment.

I really appreciate your assistance.

Check out this link for some info about how to attach a file.

Click here

Use a Zip file Format, as the Windows users have problems opening a .sit file.

HTH

Lee

cool.gif

  • Author

Unfortunately that link does not discuss any limitations on the types of files that may be attached. Let's see if I can attach a zip file. It should list that somewhere and also mention that unless one previews the post it is not possible to attach a file at all.

For the record here is the error message I got: The files you may upload must have the following extension: .gif,.jpg,.txt,.zip,.sit,.hqx,.pdf,.tar,.sitx,.png

ClientUIcopy.fp7.zip

Your sort scripts are missing from the demo, but I don't think it matters. Do as I suggested before, setting a global with the last sorted state, and have your sort script branch based on that.

  • Author

My apologies, I had two layouts that had sorts on them and I ASSUMED that I had the right one ... but it was the other one. But I will implement your suggested script changes in both of them. If you are still interested in the real one let me know and I'll post it.

Many thanks

  • Author

I made the changes that you suggested and the sort is now working as I had wanted. Once again, many thanks. wink.gif

There is an example of this in the extras folder of your filemaker 7 directory, it is in the documents library file.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.