Solved

SPO Open List from Other List in Dialog with Filter

Posted on 2016-10-27
3
29 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 14

Accepted Solution

by:
SneekCo 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 14

Expert Comment

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now