AutoComplete over Document Library – only first level folders

Forums Autocomplete AutoComplete over Document Library – only first level folders

Viewing 2 reply threads
  • Author
    Posts
    • #37144
      Michal Riha
      Participant

      Hi,
      is it possible use AutoComplete over Document Library and get only first level folder (names)? I can see only documents but not folders.
      Thanks
      Michak

    • #37149
      Alexander Bautz
      Keymaster

      You can do that using a query like this. Please note that you must change the /site/doc_lib_name search text to match your doc library FileDirRef

      spjs.ac.textField({
          "applyTo": "your_field_name",
          "helpText": "Start typing",
          "loadText": "Searching...",
          "listGuid": "your_doc_lib_name_or_guid",
          "listBaseUrl": _spPageContextInfo.webServerRelativeUrl,
          "showField": "FileLeafRef",
          "searchFields": ["FileLeafRef"],
          "filterCAML": "",
          "useREST": true,
          "preloadData": true,
          "filterREST": "FSObjType eq 1 and FileDirRef eq '/site/doc_lib_name'",
          "optionDetailFields": [],
          "optionDetailPrefix": [],
          "enforceUniqueValues": false,
          "rowLimit": 15,
          "listOptionsOnFocus": true,
          "minLengthBeforeSearch": 1,
          "reValidateOnLoad": true,
          "allowAddNew": true,
          "isLookupInSelf": false,
          "addNewAdditionalFields": [],
          "multiselect": false,
          "multiselectSeparator": "; ",
          "orderBy": [],
          "clearSetFieldsOnInvalidSelection": true,
          "setFields": [],
          "debug": false
      });
      

      Alexander

    • #37150
      Michal Riha
      Participant

      Many thanks, it works perfectly! Michal

      • #37152
        Alexander Bautz
        Keymaster

        Thanks for the feedback – I’m glad it worked.

        Alexander

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