Only start search in autocomplete after x number of chars ?

Forums Autocomplete Only start search in autocomplete after x number of chars ?

This topic contains 7 replies, has 2 voices, and was last updated by  Alexander Bautz 11 months, 3 weeks ago.

  • Author
    Posts
  • #14322

    Erik Thomte
    Participant

    If the list autocomplete is connected to has a lot of items the search should perhaps only trigger after perhaps 3 chars typed.
    Ref. standard SP people picker, starts search after 3 chars typed in the field

    Is there some hidden params for this in autocomplete ? Or a possible new feature, which is perhaps easy to implement ?

    Alternative is probably use a JS function with onkeyup “listener” tied to the AC field, and call spjs.ac.textField if stringlength>=3 , but a built-in solution would be better for later maintenance.

    Another idea for a new feature in Autocomplete would be to have the possibility to search in a specific field, but display values from another field in the display area/dropdown)

    Use case: search in title field (companyname), but display a field that contains combined value of companyname and other field values (string values) from the item to better identify the correct choice for the end user (eg companytype/ geograhic location /registered main contact for company etc.)

    “showField”:”Title”, //regular
    showExtInfoField : “AnotherField”; //new param
    DisplayExtInfoField: True ; //new param, true = show/display text from showExtInfoField instead of showfield

    Regards
    Erik

    • This topic was modified 1 year ago by  Alexander Bautz. Reason: Moved to correct forum
  • #14324

    Erik Thomte
    Participant

    Sorry, wrong forum, should be in autocomplete.
    -Erik

  • #14341

    Alexander Bautz
    Keymaster

    I’ll add a default setting of string length of 3 character before starting the seach, and add an option to override it in each “config”. I’ll look into the display value format – this is a good idea and will ease the selection of the right item.

    I’ll try to get this out soon.

    PS: I’ll move this question into the correct forum.

    Alexander

  • #14395

    Erik Thomte
    Participant

    Hi again

    Thanks for adding my suggestions to Autocomplete, and thanks for your support and help.

    I tried my idea about *onkeyup “listener” tied to the AC field, and call spjs.ac.textField if stringlength>=3 ‘, but that didn’t work well – probably related to autocomplete “taking over” the field when it kicked in (lost focus, or AC didn’t work properly).

    Also tried to make some changes in the SPJS-ac.js, but ran into issues with the browser not picking up changes. Seems like the browser cached like crazy, and kept using the original js file ,Ctrl+F5 didn’t help.. Had to manually delete all the files in the browser cache, and then reload to get the browser to use the updated content.
    Perhaps related to doc.library revision number of the file (noticed in Chrome that the file had a content source reference “?rev=number” param), or perhaps date/timestamp issues. Annoying and timeconsuming.

    With those issues and combined with my limited JS skills I called it a day.

    FYI. It seems like the “Notify me of follow-up replies via email” don’t work properly. I didn’t receive any mail after your reply on monday; I just checked the forums “on my own” this evening.

    Thanks
    Erik

  • #14518

    Alexander Bautz
    Keymaster

    I’m getting my email notifications (even though I need some time to respond…) – could it be that the messages have been marked as SPAM?

    Regarding cashing – I have already added the version number to to all files in the new “DFFS loader” version, but the version number is set in the “loader”, and it will not update the file if you only add a new version of a plugin.

    You will find an option to clear browser cache in the “Network” tab in the developer tool (hit F12 > Network).

    Alexander

  • #14532

    Erik Thomte
    Participant

    Hi again

    Got the mail notification on your last reply, thanks. Nothing in SPAM though. Probably an issue on my side, I’ve missed a couple of mails lately (totally random, so it’s hard to track down).

    Thanks
    Erik

  • #14601

    Erik Thomte
    Participant

    Hi again

    Updated to DFFS v4.4.2.2 and AC 1.4.12.

    For autocomplete field attribute “optionDetailFields” works fine, and also attribute “minLengthBeforeSearch”.

    Thanks and merry Christmas.
    Erik

  • #14621

    Alexander Bautz
    Keymaster

    Thanks for the feedback and merry Christmas to you also.

    Alexander

You must be logged in to reply to this topic.