Document library in Related item control

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
RMIC
Posts: 96
Joined: Sun May 10, 2015

01 Jun 2015

Hello,


I have in the "Related item control" a document library. This document library has several folders.

These folders can have subfolders. The number of subfolders depend on the selected data set, which is in the SP form.

What is the best handling and assignment of documents to a folder? (possibly Rootfolder (property that is visible in IE debugger)? If so, how? or more document libraries ..)

When I'm in a subfolder, how do I back to the main folder (except the back button of the browser)?

When I click on a folder, I land in another tab and must again click in the actual tab. How do you get around?


In another tab I have a document library, which should not be edited. Edit I've disabled. Nevertheless, it is possible to add documents via drag & drop. Why?


Many Thanks!

I have SP-2013 and Form Designer 2.9.1.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

02 Jun 2015

Hi,

I'd recommend to display related documents without folders. You can retrieve all documents relating to the current item recursively by adding the following attribute to the View element: Scope="RecursiveAll". To add this attribute, please, select the Related items control in Forms Designer and open its View property.

If you need to group documents relating to the current item, say by folder, content type or field value, I'd recommend to use different libraries for different types of documents and display them in separate Related items controls. Or you can create multiple views for the same library and display different views in separate Related items controls.

As for uploading documents via drag & drop, you can disable this functionality by adding an HTML-control with the following content onto your form:

Code: Select all

<script type="text/javascript"> 
      WPQRegisterDragDropUpload = function() {} 
</script>

RMIC
Posts: 96
Joined: Sun May 10, 2015

02 Jun 2015

Hi Dmitry, Thanks a lot for your help! With the Scope = "RecursiveAll" and disable the Drag and drop works. Thank you! The multiple of document libraries are advantageous, I thought so. Through the use of several libraries I already save me a few folders. But when I use no subfolders, it may partially be a bit confusing because it can be a lot of documents. Should I use subfolders, there is a way, if I'm in the subfolder to come back (within the SP-FORM)?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

03 Jun 2015

Unfortunately, SharePoint doesn't allow to navigate through folders for multiple libraries on the same page. That is why, I recommend you to avoid folders in Related items controls. But if you have a lot of documents in the library, you can group them by a field in the view settings to simplify navigation through them. Next, use this view in the Related items control.

RMIC
Posts: 96
Joined: Sun May 10, 2015

04 Jun 2015

Thanks Dmitry.

Then I'm going to do with groups.


For testing purposes, I have a document library in a Related item control with folder.

When I'm in a folder and I want to back, I built me a link to an HTML-control:

<a href="javascript:history.go(-1)"> back </a>

Is certainly not a good way. But to test it enough.

With this link, I'll come back out of the folder, but land in another tab (always in the first - so far left) within the Related item control.

Even if I click on a folder, I land in a different tab.

How can I prevent that? I want to always be in the same tab.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

04 Jun 2015

Hi,

Please, put the following code into the JS-editor. Replace the tab index (2) with zero-based index of the tab containing the Related items control.

Code: Select all

if (GetUrlKeyValue('RootFolder')) {
	$('#fd_tabcontrol-0').tabs('option', 'active', 2);
}

RMIC
Posts: 96
Joined: Sun May 10, 2015

05 Jun 2015

This works, thanks.

Is it possible, by a 'Related item control' the column names to hide? So that only the data is visible.

Is it possible to count the number of items (or rows) in a Related item control?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

08 Jun 2015

Hi,

1. Yes, you can hide the header with the help of JSLink:

http://www.codeproject.com/Articles/620 ... List-Views

2. Please, follow the instructions to output the number of rows in the related items:

http://sharepointlogics.com/2010/03/tot ... st-in.html

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests