Solved

SPO Open List from Other List in Dialog with Filter

Posted on 2016-10-27
3
65 Views
Last Modified: 2016-10-28
Working with SharePoint Online/365, I want to open a SharePoint list from another list on field click. I can get the list in a dialog with the following:

function openDialog(myProject) {  
   SP.UI.ModalDialog.showModalDialog(   
     {  
       url: "https://mysite.sharepoint.com/sites/develop_apps/Lists/ProjectCommunications/AllItems.aspx",
       width: 1000,
       title: "Project Communications"  
     }  
   );  
 }

Open in new window


This works great. But how can I open that list filtered? I've tried:

function openDialog(myProject) {  
   SP.UI.ModalDialog.showModalDialog(   
     {  
       url: "https://mysite.sharepoint.com/sites/develop_apps/Lists/ProjectCommunications/AllItems.aspx#FilterField1%3DProject-FilterValue1%3D" + myProject,
       width: 1000,
       title: "Project Communications"  
     }  
   );  
 }

Open in new window


but that gives me "no items to show"

What is the correct way to filter via URL, if possible?
0
Comment
Question by:Michael Vasilevsky
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Walter Curtis earned 500 total points
ID: 41864033
I don't think this will help because it is from SharePoint on premise, but maybe.

I have never used the string as you have it:

AllItems.aspx#FilterField1%3DProject-FilterValue1%3D" + myProject,

which is not to say it is wrong, just something I have never seen.

In most of my situations, I am using a relational list and I go to one of the form pages such as display or edit, however it should work too with allitems. The string would be very simply such as this;

/display.aspx?ID=123

That would open the display form for the item with the ID from the string.

Hope that helps...
0
 
LVL 10

Author Comment

by:Michael Vasilevsky
ID: 41864242
0
 
LVL 17

Expert Comment

by:Walter Curtis
ID: 41864258
Glad you got it working. Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending ASP to server side 8 33
Echo'd values in dropdowns 6 32
Open grouped links on a page in new tabs via jquery 5 47
Make Float not to Wrap 15 37
Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question