Hide listview group headers

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
Adam Reyes
Posts: 35
Joined: Tue Mar 04, 2014

30 Jan 2019

Is there a way to hide listview group headers in the form? I have a related items section inside the form and need to group by a certain field but would like to hide the header name. I know how to do this in SharePoint 2013 Web part page and script editor but it doesn't seem to work in Forms Designers Javascript framework:

<script src="/SiteAssets/JQuery/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("table.ms-listviewtable > tbody[id^='titl']").each(function () {
var htmlStr = $(this).find("td").clone().html();
//"Name" is the group name
htmlStr = htmlStr.replace(" :", "").replace("CAR Type", "");
$(this).find("td").html(htmlStr);
});
});
</script>
hide list headers.png
hide list headers.png (17.52 KiB) Viewed 2203 times

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

31 Jan 2019

Dear Adam,

Your code has already handled this issue, just paste it in the JavaScript Editor without <script> tags:

Code: Select all

$("table.ms-listviewtable > tbody[id^='titl']").each(function () {
var htmlStr = $(this).find("td").clone().html();
//"Name" is the group name
htmlStr = htmlStr.replace(" :", "").replace("CAR Type", "");
$(this).find("td").html(htmlStr);
});

User avatar
Adam Reyes
Posts: 35
Joined: Tue Mar 04, 2014

01 Feb 2019

Ah I see what you did there, I didn't have to nest it into that first function. Thank you very much Alex!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests