vlookup search feature

Forums vLooup for SharePoint vlookup search feature

Tagged: 

Viewing 7 reply threads
  • Author
    Posts
    • #28839
      HYM
      Participant

      Alex, do we have any search option for the vLookup table? for example like jquery datatable.

    • #28863
      Alexander Bautz
      Keymaster

      You can use the datatable plugin, but you must use the vLookupIsLoadedCallback function and call the code when your field has loaded: https://spjsblog.com/vlookup-for-sharepoint/vlookup-user-manual/#vLookupIsLoadedCallback

      Add this to the “Load these CSS files” over your Custom CSS:

      //cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css

      And this to the “Load these files” over your Custom JS:

      //cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js

      And this to your Custom JS:

      function vLookupIsLoadedCallback(fin){
          if(fin === "vLookupTasks"){
              jQuery("#dffs_vLookupTasks .vLookupTable").not(".dataTables").DataTable();
          }
      }

      This example uses a field named vLookupTasks – change it to match your field.

      Alexander

    • #28869
      HYM
      Participant

      Okay thank you I will try this, and Alex if I want to check if the vLookup contains some folders, I tried the dataObj[] but its counting only the documents and not the folders. How can I check how many folders and items I have in the vLookup?

    • #28871
      Alexander Bautz
      Keymaster

      I haven’t though of that, but if it is root folders you can use something like this:

      function vLookupIsLoadedCallback(fin){
          if(fin === "vLookupDocuments"){
              var folderCount = jQuery("#dffs_vLookupDocuments .vLookupFolderTable").length;
              alert(folderCount);
          }
      }

      Replace vLookupDocuments with your field internal name.

      Alexander

    • #28874
      HYM
      Participant

      Hi alex, the vlookup datatable worked fine but for vlookup documents when you click the manual refresh the vlookup disappear.

    • #28878
      Alexander Bautz
      Keymaster

      Not sure I follow – can you give me some more details?

      Alexander

    • #28887
      HYM
      Participant

      for vLookupItems, the jquery datatable works fine but for the vLookupDocuments if you upload new document and the vLookup is refreshed the data will disappear and in the console we have an error “_DT_CellIndex” jqeury.datatable.min

    • #28891
      Alexander Bautz
      Keymaster

      If you use folders or group the vLookup table it might not work – and please note that I don’t have an “official” support for using datatables for the vLookup table so it it does not work I’m afraid I cannot promise any fix for it.

      If you only need the search feature, I wrote a snippet about a year ago: https://spjsblog.com/forums/topic/vlookup-search/

      Alexander

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