javascript - Hiding List View web parts when they are empty ( Sharepoint ) -



javascript - Hiding List View web parts when they are empty ( Sharepoint ) -

looking on google , found code . need include script in page hide empty lists . how can ?

<script type="text/javascript"> function hideemptywebparts() { var itemsfound = new array; var elements = document.getelementsbytagname('*'); for(var i=0;i<elements.length;i++) { if(elements[i].classname == 'ms-vb') { itemsfound.push(elements[i]); } } (var i=0;i<itemsfound.length;i++) { if (itemsfound[i].innerhtml.indexof("there no items show in view of the")>-1) { itemsfound[i].parentnode.parentnode.parentnode.parentnode.innerhtml="<div class='ms- vb'>not plenty info produce dashboard.</div>"; } } } _spbodyonloadfunctionnames.push("hideemptywebparts") </script>

put in master page if want apply in whole site. or reference it. if want apply in specific page, add together content editor , paste in html.

javascript sharepoint-2010

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -