>Fjern titler fra listeview webpart

>Sådan fjerne man titlerne/overskrifterne fra webpart med lister:

Resultat:

Indsæt en “webparten Indholdsredigering” og indsæt følgende kode:

<script type=”text/javascript” language=”javascript”>
_spBodyOnLoadFunctionNames.push(“HideHeaders”);
function HideHeaders()
{
var elements = getElementsByClassName(document, “tr”, “ms-viewheadertr”);
for(var i=0;i<elements.length;i++)
{
elem = elements[i]; elem.style.display = “none”;
}
}
function getElementsByClassName(oElm, strTagName, strClassName)
{
var arrElements = (strTagName == “*” && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
var arrReturnElements = new Array();
strClassName = strClassName.replace(/\-/g, “\\-“);
var oRegExp = new RegExp(“(^\\s)” + strClassName + “(\\s$)&quot;);
var oElement;
for(var i=0; i<arrElements.length; i++)
{
oElement = arrElements[i];
if(oRegExp.test(oElement.className))
{
arrReturnElements.push(oElement);
}
}
return (arrReturnElements)
}
</script>

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: