Seven0fNine
asked on
SharePoint 2016 on-prem viewing Task details on same page as Task list
On my webpage I have a SharePoint Task list (list view web part) with columns like below:
Task name Assigned To Ref Description
----------- ------------- ---- ------------
t999 person A 45 Internal process
t1000 person B 21 External process
t899 person C 54 EMEA
The 'Task Name' column contains links to the DispForm.aspx which contains further details about the task that is clicked on. My question is, instead of viewing the task details in the DispForm.aspx on another webpage, can I pass the task name link URL or a parameter to another web part on the same page as the task list, like below?
TASK LIST -----------> WEB PART CONTAINING MORE DETAILS ABOUT THE TASK
I've tried using the SharePoint Query URL filter and Webpart filters to pass the Task Name link URL to a page view webpart without much success.
Any help with this will be much appreciated.
Task name Assigned To Ref Description
----------- ------------- ---- ------------
t999 person A 45 Internal process
t1000 person B 21 External process
t899 person C 54 EMEA
The 'Task Name' column contains links to the DispForm.aspx which contains further details about the task that is clicked on. My question is, instead of viewing the task details in the DispForm.aspx on another webpage, can I pass the task name link URL or a parameter to another web part on the same page as the task list, like below?
TASK LIST -----------> WEB PART CONTAINING MORE DETAILS ABOUT THE TASK
I've tried using the SharePoint Query URL filter and Webpart filters to pass the Task Name link URL to a page view webpart without much success.
Any help with this will be much appreciated.
you mean you click on the Task name and the other webpart update without refreshing the page?
ASKER
Yes that would be great if any Task name (in the initial task list) was clicked and the other webpart could dynamically display additional details like percentage complete, comments etc. about the clicked Task.
you can use ajax to get the another webpage content displayed in the other webpart when user click on a Task name
ASKER
I know that ajax/ java is possible, I did start experimenting with the following code, but don't know how to extract the Task name URL and pass that to the page viewer web part or content viewer web part in code.... I have a click event that fires when clicked within a task row.. but stuck with extracting the task URL and passing that to the 'other' web part to view task details.....
<script src="https://code.jquery.com/jquery-1.11.2.min.js" type="text/javascript"></s cript><scr ipt type="text/javascript">
$(document).ready(function () {
$(".ms-listviewtable > tbody > tr").click(function(){
setTimeout( function() {
//alert("tasklist");
var ctx = SP.ClientContext.get_curre nt("http://everynet/GJEDashboard/Pages/default.aspx");
var items = SP.ListOperation.Selection .getSelect edItems(ct x);
var clientContext = new SP.ClientContext();
var oList = clientContext.get_web().ge t_lists(). getByTitle ('TaskName URL');
alert(oListItem.val);....
//GET TASK URL
//PASS TO OTHER WEB PART
<script src="https://code.jquery.com/jquery-1.11.2.min.js" type="text/javascript"></s
$(document).ready(function
$(".ms-listviewtable > tbody > tr").click(function(){
setTimeout( function() {
//alert("tasklist");
var ctx = SP.ClientContext.get_curre
var items = SP.ListOperation.Selection
var clientContext = new SP.ClientContext();
var oList = clientContext.get_web().ge
alert(oListItem.val);....
//GET TASK URL
//PASS TO OTHER WEB PART
You can probably do what you want to do by using an additional view that has the information you want and adding it to the same page. Then you can connect the web parts so that when the focus changes on the top view the lower view will also change focus. No need for any coding. You may need to do some researching on how to connect web parts.
Good luck...
ASKER
This is the script when inspecting the task name link. The task name here is Case file... How would you capture or pass this URL to another web part to view further details of the clicked task?
<a class="ms-listlink" onfocus="OnLink(this)" href="http://everynet/GJEDashboard/_layouts/15/listform.aspx?PageType=4&ListId=%7B156FB074%2D741D%2D4B6D%2D9437%2D9AD2B312A778%7D&ID=1273&ContentTypeID=0x010800E2D0B22BC004AC4B998B349A8D7E5209" onclick="EditLink2(this,63 );return false;" target="_self">Case file</a>
<a class="ms-listlink" onfocus="OnLink(this)" href="http://everynet/GJEDashboard/_layouts/15/listform.aspx?PageType=4&ListId=%7B156FB074%2D741D%2D4B6D%2D9437%2D9AD2B312A778%7D&ID=1273&ContentTypeID=0x010800E2D0B22BC004AC4B998B349A8D7E5209" onclick="EditLink2(this,63
open the task detail page and do the same for the container of the whole task details
we need to find a class or id of the container
if you need help and if possible, post the whole content of the page (view source of the page)
we need to find a class or id of the container
if you need help and if possible, post the whole content of the page (view source of the page)
here what we have :
$(document).ready(function() {
$(".ms-listlink", ".ms-listviewtable > tbody > tr").click(function (event) {
event.preventDefault();
//GET TASK URL
var tasklist = $(this).attr("href");
$.("DIV OF THE OTHER WEB PART").load (href+ " COMTAINER-LIKE-A-DIV-OF-THE-TASK-DETAIL");
});
});
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.