Monday, 27 January 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.

1 comment:

  1. Excellent. Thanks for the code. Worked perfectly.

    ReplyDelete