There are no items to show in this view of the listname list in SharePoint 2010

This SharePoint 2010 tutorial, we will discuss how to customize the message There are no items to show in this view of the “list name” list which comes if there are no items in the SharePoint list.

There are no items to show in this view sharepoint

By using a piece of JavaScript code, we can customize the “There are no items to show in this view” message.

To do this, edit the SharePoint list view page and add a content editor web part to the page and in the source write the below code:

<script>
function ChangeNoListItemDefaultMessage()
{
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 of the "TestList1" list.”)>-1)
{
a[i].innerHTML = "Opps !!! No Items !!!”;
break;
}
}
}
}
_spBodyOnLoadFunctionNames.push("ChangeNoListItemDefaultMessage”)
< /script>

Once you Save and refresh the SharePoint list view page, you can see the message as “Opps !!! No Items !!!” rather the out of box message “There are no items to show in this view”.

You may like following SharePoint JavaScript tutorials:

Here, we learned how to customize there are no items to show in this view message in the sharepoint list view.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>