2

I have a library to store files (obvious) with column "City" which is a lookup to list with two columns (CityName & Order).

How to change ordering of options in dropdown field (which is in NewForm.aspx)?

At this moment it's still sorted by ascending ID. In list AllItems view shows it as it should be (sorted by "order").

0

All lookup column choices are sorted alphabetically by default. Apparently you will need to use jQuery for that. I've found an article which is very similar to what I followed a while back: http://sympmarc.com/2012/05/11/using-spfilterdropdown-to-reorder-options-in-a-dropdown-on-a-sharepoint-form/

$().SPServices.SPFilterDropdown({
 relationshipWebURL: "/", // The source list for the Recommendation site Column is in the root site
 relationshipList: "Recommendations",
 relationshipListColumn: "Title",
 relationshipListSortColumn: "SortOrder",
 columnName: "Recommendation",
 CAMLQuery: "<Neq><FieldRef Name='Title' /><Value Type='Text'></Value></Neq>", // Get all values by specifying a non-blank Title
 debug: true // Debug mode on while we're developing
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.