Skip to main content

Greetings,


Requirments: When user clicks on the tasklist to open the task from K2 Worklist, it should open in new tab of the browser. The Version of Internet Explorer 9.


Reference: http://help.k2.com/en/KB000632.aspx


Tried:



  1. Located TableFactory.js file in the following two locations:
  2. C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14TEMPLATELAYOUTSK2TaskListJS


  • C:Program FilesK2 blackpearlWorkSpaceSiteTaskListControlScript


  1. Right-click on the TableFactory.js files and click on Edit.
  2. Add the following code under the “Open the worklist item” comment in the "PerformAction" function.

If (Target!=”_self”)
Target=”_blank”;


Still not able to open the worklist in new browser tab. Is there something more I need to take care of.

I'm assuming you are referring to the K2 Worklist web part in SharePoint.

 

Does the task form open at all? If it opens in the same tab or window you have to change the settings of the web part.

 

In edit mode,  click on the drop down arrow at the top right of the web part and select Edit Web Part. In the Worklist Settings section make sure the Open Task Page in New Window box is checked. Click OK to save the settings.

 


If you copy and paste the code block from the KB, the double quotes seems to be a different encoding.  As such, I would just add the code manually in your editor (typing it out), as this would usually provide the correct encoding.  Also change the capitalize "If" to "if"


 


if (Target!="_self")
 Target="_blank";


 


* Copying produces ” instead of " when typing.


** Javascript is case-sensitive, as such change the capitalize "If" to "if"


 


Additionally, there are two "Open the worklist item" nodes when searching for the place to insert this code in the file, one corresponds to clicking on the actual task list item, the other correspond to using the drop down options and selecting "Open"; add it to both location if you want this behavior for both.


Reply