Sorting SPJS Lookup in descending order

Forums SPJS-Lookup Sorting SPJS Lookup in descending order

Tagged: 

This topic contains 6 replies, has 2 voices, and was last updated by  Tony Khalil 6 months ago.

  • Author
    Posts
  • #20203

    Tony Khalil
    Participant

    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

  • #20231

    Alexander Bautz
    Keymaster

    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

    • #20244

      Tony Khalil
      Participant

      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”
      }

    • #20251

      Alexander Bautz
      Keymaster

      I see, the orderBy functionality was added in v1.1.8

      This means you must update to a later version.

      Alexander

  • #20256

    Tony Khalil
    Participant

    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

  • #20284

    Alexander Bautz
    Keymaster

    Hi,
    The orderBy property is not part of the “filterObj” – look at this example to see where to add it: http://spjsblog.com/dffs/dffs-plugins/spjs-lookup/#Example_configuration

    Alexander

  • #20309

    Tony Khalil
    Participant

    HI,

    Working as expected now. thanks again.

    Regards,

    Tony

You must be logged in to reply to this topic.