Hide listview group headers
- Adam Reyes
- Posts: 35
- Joined: Tue Mar 04, 2014
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>
<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>
Dear Adam,
Your code has already handled this issue, just paste it in the JavaScript Editor without <script> tags:
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);
});
- Adam Reyes
- Posts: 35
- Joined: Tue Mar 04, 2014
Ah I see what you did there, I didn't have to nest it into that first function. Thank you very much Alex!
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests