none
Office 365 - Open list item in new tab or window RRS feed

  • Question

  • Hi,

    I am using office 365 sharepoint

    List which has two level of grouping.

    I want to open list item in new window or new tab.

    By default it opens in same tab.

    Please give code.

    Thanks,

    Saturday, December 17, 2016 10:43 AM

All replies

  • Hi,

    If you want to open list items of custom list in new tab, you could try to use jQuery to update the links’ target property, below is sample code for your reference:

    (Insert script editor to the page of your list view and then insert the js code into the web part.  )

        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                $('div [field=LinkTitle] a').attr('target', '_blank');
                $("#group1 a").each(function () {
                    $(this).click(function () {
                        $('div [field=LinkTitle] a').attr('target','_blank');
                    });
                })
            });
        </script>

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, December 19, 2016 5:11 AM
  • Hi Lee,

    I have two level grouping in the list.

    This code is not working for the same.

    This code works fine if list does not have any grouping.

    Thanks,

    Monday, December 19, 2016 7:17 AM
  • Hi,

    Try this:

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                $('div [field=LinkTitle] a').attr('target', '_blank');
                $("#group1 a").each(function () {
                    $(this).click(function () {
                        setTimeout(function () {
                            $('div [field=LinkTitle] a').attr('target', '_blank')
                        }, 1500);
                    });
                })
            });
        </script>

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, December 19, 2016 7:51 AM
  • Hi,

    Is any update for your issue?

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, December 23, 2016 8:18 AM