Answered by:
Change/Remove default text when lists are empty

Question
-
Hi,
How do you change or remove the default text like "There are no items to show in this view of the "Documents" document library. To create a new item, click "New" or "Upload" above."?
This text displays when a list or library is empty and is a default out-of-the-box behaviour.
Regards,
JeremyFriday, March 11, 2011 12:00 PM
Answers
-
Hi,
According to your description, I suggest that you should use JavaScript to do with it. For example, go to the document library which you want to modify, Site Action-> Edit Page->select add a web Part->choose Content Edit Web Part.
And then you need to a following sample code in Source Edit:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type ="text/javascript" >
$(document).ready(function() {
$("table.ms-listviewtable table td.ms-vb:contains('There are no items')").text("");
});
</script>
Please have try.
Best regards
David Hu- Marked as answer by Peng Lei Monday, March 21, 2011 1:20 AM
Tuesday, March 15, 2011 1:16 AM
All replies
-
Hi Jeremy,
Like you said, it's a default out of the box behaviour. You can create a data view of that list/document library using SharePoint Designer. In that dataview, you have the ability to show whatever you want when the list/library is empty.
Pman
http://www.pmansLab.com/Saturday, March 12, 2011 5:26 PM -
Hi Jeremy,
you can do this by adding a script in a content editor webpart.
Check my post @ http://chanakyajayabalan.wordpress.com/2010/03/09/change-create-new-item-message-in-list-web-parts/ which explains this clearly.
Thanks,
ChanakyaMonday, March 14, 2011 9:14 AM -
Hi,
According to your description, I suggest that you should use JavaScript to do with it. For example, go to the document library which you want to modify, Site Action-> Edit Page->select add a web Part->choose Content Edit Web Part.
And then you need to a following sample code in Source Edit:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type ="text/javascript" >
$(document).ready(function() {
$("table.ms-listviewtable table td.ms-vb:contains('There are no items')").text("");
});
</script>
Please have try.
Best regards
David Hu- Marked as answer by Peng Lei Monday, March 21, 2011 1:20 AM
Tuesday, March 15, 2011 1:16 AM -
Although this is somewhat hacky, it is the method I used to solve this problem. I don't have access to Sharepoint Designer, so this jQuery solution was the ticket.
Just a note, if you have any AJAX updates (automatic refresh, for example) enabled, the 'There are no items to show...' text will reappear. jQuery will not get rid of it because this function is only run on document.ready()
Thursday, February 28, 2013 9:34 PM -
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type ="text/javascript" > $(document).ready(function() { $("table td.ms-vb:contains('There are no items')").text(""); }); </script>
Only this
$("table td.ms-vb:contains('There are no items')").text("");
also works
Your solution didnt worked in my case, but was helpful. I could find any table with class .listviewtable
Regards:
Gaurravs
Monday, September 14, 2015 7:06 AM