Home › Forums › SPJS-Lookup › Sorting SPJS Lookup in descending order
Tagged: SPJS-lookup
- This topic has 8 replies, 3 voices, and was last updated 5 years, 6 months ago by Alexander Bautz.
-
AuthorPosts
-
-
March 13, 2018 at 12:44 #20203
Hi Alexander,
I am using SPJS lookup to convert a textfield into a dropdown. The listed values in the dropdown are sorted in Ascending order. i need to make them appear in descending order.
I tried to set the Ascending property in SPJS-lookup.js to False but it did not work.
Any help from your side is really appreciated.Regards,
Tony
-
March 14, 2018 at 21:28 #20231
Hi,
I tested it and it works in my setup – what version of the spjs-lookup plugin are you running?Please note that false is written in lower case and without quotes like this:
... ... "orderBy": { "fin": "Title", "ascending": false }, ... ...
Alexander
-
March 15, 2018 at 08:19 #20244
Below is my filterObj still not working. I am working on [SPJS-Lookup plugin 1.1.5]
“filterObj”: {
“on”: false,
“folder”: “”, // Leave empty to search in all folders
“CAML”: null, // If used, the rest of the filterObj settings are disregarded
“fin”: “ActiveStatus”,
“ascending”: false,
“isLookup”: false,
“operator”: “Neq”,
“filterVal”: “Inactive”
} -
March 16, 2018 at 00:14 #20251
I see, the orderBy functionality was added in v1.1.8
This means you must update to a later version.
Alexander
-
-
March 16, 2018 at 09:56 #20256
Thank you for your replies Alexander.
I updated DFFS and now i have [SPJS-Lookup plugin v1.1.9]It is still not changing with the below code:
“filterObj”: {
“on”: false,
“folder”: “”, // Leave empty to search in all folders
“CAML”: null, // If used, the rest of the filterObj settings are disregarded
“fin”: “ActiveStatus”,
“ascending”: false,
“isLookup”: false,
“operator”: “Neq”,
“filterVal”: “Inactive”
}Setting the ascending to false or true is changing nothing. You mentioned the orderBy functionality and not the ascending property. Am i missing a parameter that i should use.
Regards,
Tony
-
March 18, 2018 at 15:12 #20284
Hi,
The orderBy property is not part of the “filterObj” – look at this example to see where to add it: https://spjsblog.com/dffs/dffs-plugins/spjs-lookup/#Example_configurationAlexander
-
March 19, 2018 at 10:06 #20309
HI,
Working as expected now. thanks again.
Regards,
Tony
-
June 12, 2019 at 03:59 #25676
Hi Alex, I’m having a similar issue. My vlookup is running on : v2.2.129, I’m calling the init function successfully w/ no probs, but recently tried to add a sort order. If I leave everything alone (default sort = Title) and change ascending to false (as a test) it still won’t sort descending. If I try to supply a fin to replace title it ignores it completely. I’m passing an object “dd” to the function that calls init() and no matter what I do I can’t change sort order:
spjs.lookup.init({ "fieldToConvertToDropdown": [ dd.fieldName ], "listName": dd.listName, "listBaseUrl": siteUrl, "optTextFieldInternalName": dd.selectField, "pipeDelimitedOptions": "false", "optValFieldInternalName": "ID", "orderBy": { "fin": dd.sortOrder, "ascending": true }, "clearInvalidSelections": true, "filterObj": { "on": dd.filterObject.filterOn, "folder": "", "CAML": dd.filterObject.CAML, "fin": dd.filterObject.fin, "isLookup": false, "operator": dd.filterObject.operator, "filterVal": dd.filterObject.filterVal }, "dropDownDefaultvalue": "", "allowBlank":true, "parseFunction": "", "addYouOwnValue": { "on": false, "linkText": "Write your own value" }, "addToExternalList": { "on": false, "customFunction": null, "linkText": "Add new item", "saveNewItemText": "Save new item" }, "debug": false, "customSort": "" });
Can you help?
-
June 12, 2019 at 20:12 #25696
Hi,
You are absolutely right – It seems I have broken the orderBy functionality somewhere along the line. I have attempted a fix in the attached version – see if it works out.Please note that you must clear the browser cache and ensure it lists as SPJS-Lookup v1.1.17 (the version number you refer to is for SPJS-vLookup and not SPJS-lookup).
Alexander
Attachments:
-
-
AuthorPosts
- You must be logged in to reply to this topic.