Jump to content
Server Maintenance This Week. ×

GetFields sorted by the layout


This topic is 4342 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hi Folks

I'm creating an export function for users, where they can choose (over an website) a layout and then appears a list with all fields inside this layout. The user now chooses which fields he would have in the export. The problem is the listing of the fields seems to be random. Is it possible to influence this order?

An example:

I have a layout with data of clients like name, phone, adress, email etc. So I get these fields with the getFields() function. But I like to have them in a certain order, so when i get the single fields out of the array in the order of:

Name, Adress, Phone, Mail etc.

Thank you very much for your help!

Link to comment
Share on other sites

In Manage Database...under the Fields tab, you have the choice of how to view the fields. The default is Creation Order, but you can choose "Custom Order". You can reorder the fields anyway you'd like and that re-ordering will also show on most of the field list dialogs (including Export...)

Link to comment
Share on other sites

  • Newbies

I do the export over php. First of all, the possible fields have to be listed, so the user can choose the needed ones. But the order of these fields is in creation order, even if I change the custom order. (I get the field names with the function getFields() )

I think there is no other way to sort the fields with arrays as webko wrote.

Thanks for the replies!

Link to comment
Share on other sites

This topic is 4342 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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