Load parent form with folders in "open" state on load

Home Forums vLooup for SharePoint Load parent form with folders in "open" state on load

Viewing 4 reply threads
  • Author
    Posts
    • #9965
      chgrnet
      Participant

        Is there a way to get a parent form to load a vLookup document library folder in the open state (showing files in the folder) when the form is loaded?

        One other question about folders, is there a way to turn the “add folder” link off if one folder has been created? Thanks!

        • This topic was modified 8 years, 10 months ago by chgrnet.
      • #10070
        Alexander Bautz
        Keymaster

          Hi,
          Sorry, but this is not possible without custom code. You find a code example below.

          To expand all first level folders, and remove the “new folder” link when one folder exists add this code to the custom js textarea:

          function vLookupIsLoadedCallback(fin){
          	if(fin === "vLookupDocuments"){
          		if($("#dffs_vLookupDocuments").find("img.vLookupFolderIcon").length > 0){
          			$("#dffs_vLookupDocuments").find("img.vLookupFolderIcon").parent().click();
          			// Remove new folder link
          			$("#dffs_vLookupDocuments").find("div.vLookupAddNewFolderLabel").remove();
          		}	
          	}
          }

          The field name “vLookupDocuments” must be replaced with the field you use in your setup.

          Hope this helps,
          Alexander

          • #10346
            chgrnet
            Participant

              Thank you for this code! It works perfectly!

          • #10352
            chgrnet
            Participant

              Is there any way to have the mouse-over state of the folder always on, so the upload button always shows? Is there a way to change the upload button image to text or a different image?

            • #10367
              Alexander Bautz
              Keymaster

                Hi,
                Just add this to the custom css:

                span.spjs_folder_btn{
                  display:inline!important;
                }

                To change the images, add this to the custom js:

                spjs.vLookup.data.uploadImg = "/Path/to/the/image";
                spjs.vLookup.data.folderIcon = "/Path/to/the/image";

                Alexander

                • #10394
                  chgrnet
                  Participant

                    Thank you! This works perfectly!

                • #10403
                  avala
                  Participant

                    This is perfect! Thank you both!

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