Autocomplete, Sort, Source List Over 1,000…

Forums Autocomplete Autocomplete, Sort, Source List Over 1,000…

Viewing 3 reply threads
  • Author
    Posts
    • #27256
      BenR
      Participant

      Alexander,

      Using Autocomplete, I have found that sort of results (orderBy) fails when the source list is over 1,000 items. I am sorting by ID, descending. I have attached two screenshots – one with less than 1,000 items in the source list, and one with more than 1,000 items.

      As always, I sincerely appreciate your support and efforts!

      R’grds – Ben.
      Reference:
      Version information
      DFFS Loader: v2
      DFFS frontend: 4.4.4.10 – September 20, 2019
      DFFS frontend CSS: 4.51 / 4.51
      Autocomplete: 1.6.37 – September 04, 2019
      Cascading dropdowns: 3.7.30 – July 21, 2019
      jQuery: 1.12.4
      Lookup: 1.1.17 – July 21, 2019
      Resource management: 2.4.5 – August 29, 2019
      SPJS-Utility: 1.337 – September 04, 2019
      vLookup: 2.2.138 – September 04, 2019

      
      
      spjs.ac.textField({
       "applyTo": "TransPipeLookup",
       "helpText": "Key Transaction ID, LOB, or Name...",
       "loadText": "",
       "listGuid": "TransPipeDevX",
       "listBaseUrl": "/sites/spptdgsl/TransPipeDev/",
       "showField": "TransPipeLookup",
       "searchFields": [],
       "filterCAML": "<Where><Eq><FieldRef Name='CommodityType'/><Value Type='Text'>Tech</Value></Eq></Where>",
       "useREST": false,
       "preloadData":false,
       "filterREST": "",
       "optionDetailFields": [],
       "optionDetailPrefix": [],
       "enforceUniqueValues": true,
       "rowLimit": 15,
       "listOptionsOnFocus": false,
       "minLengthBeforeSearch": 2,
       "reValidateOnLoad": false,
       "allowAddNew": false,
       "isLookupInSelf": false,
       "addNewAdditionalFields": [],
       "multiselect": false,
       "multiselectSeparator": "; ",
       "orderBy": [
      	{
      		"fin":"ID",
      		"ascending":false
      	}
       ],
       "clearSetFieldsOnInvalidSelection": false,
       "setFields": [	
      	{
      		"fromFIN":"ID",
      		"toFIN":"KeyTransID"
      	},
      	{
      		"fromFIN":"Title",
      		"toFIN":"Title"
      	},
      	{
      		"fromFIN":"LOB",
      		"toFIN":"LOB"
      	},
      	{
      		"fromFIN":"SubLOB",
      		"toFIN":"SubLOB"
      	},
      	{
      		"fromFIN":"TechCommodities",
      		"toFIN":"TechCommodities"
      	}
      ],
       "debug": false
      });
    • #27307
      Alexander Bautz
      Keymaster

      Sorry for the delay – I’ll try to recreate this issue and get back to you as soon as I can manage.

      Alexander

    • #27311
      BenR
      Participant

      Alexander,

      I’m sorry to say that my analysis of the problem was false… As I continue to test, I’ve found that the number of items in the source list is not the cause of the problem (just a difference between my DEV to PROD environments) – sorry for the false lead.

      The problem is with the result sorting the ID field (which is a number field) is not following numerical sort (sample result: 100, 150, 2, 25, 3, 55, 550).

      Reading about SPJS-Lookup, you address this symptom in the customSort option, describing: “… This sort function example sorts values that contains numbered options from 1-10. The default alphabetical sort order would sort like this: 1, 10, 2, 3 etc., but now it will show 1, 2, 3 …”

      Is a numerical sort possible in Autocomplete?

      Again, sorry for the false lead.

      R’grds – Ben.

    • #27320
      Alexander Bautz
      Keymaster

      Hi,
      I’ll add a numeric sort option and release a new version next week. You can then specify it like this:

      ...
      ...
      "orderBy": {
      	"fin": "SortIndex",
      	"ascending": true,
      	"numeric": true
      },
      ...
      ...

      I’ll update SPJS-lookup also so you can use the same numeric sort function in both solutions.

      Alexander

Viewing 3 reply threads
  • You must be logged in to reply to this topic.