Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SPO Open List from Other List in Dialog with Filter

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

809 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