Monday, January 27, 2014

how to remove/change "There are no items to show in this view of the list. To add a new item, click New" in SharePoint 2013.


Change/Remove the message when no items in List/library - "There are no items to show in this view of the list. To add a new item, click New".
Add the below code in content editor...


<script>
function ChangeDiscussionMessage()
{

  var a = document.getElementsByTagName("TD")
  for (var i=0;i<a.length;i++)
  {
    if (a[i].className=="ms-vb")
    {
      if (a[i].innerText.indexOf("There are no items to show in this view")>-1)
      {
         a[i].innerHTML = "No items in this list.";
      }
    }
  }
}

_spBodyOnLoadFunctionNames.push("ChangeDiscussionMessage")

</script>


IF you want to do this for every list add this code to master page.

2 comments:

  1. Hi Uday,
    Our team facing one problem in workflow the problem is the workflows are prudently stopped we are unable to find out reason why workflow are stopped please send me your thoughts as early as possible please
    mail id: subbu.palla@hotmail.com
    Thanks

    ReplyDelete
  2. Excellent. Thanks for the code. Worked perfectly.

    ReplyDelete