Skip to main content
Nintex Community Menu Bar
Solved

Expand/Collapse View - Click the Entire View Header Script

  • August 26, 2026
  • 5 replies
  • 27 views

Forum|alt.badge.img+15

Hello community - I’m getting user complains that the icon to expand/collapse views on the form are too small and difficult to click. In the legacy theme, I was able to come up with some JQuery to make the entire view header clickable to expand/collapse the view, but I’m having a hard time doing the same with the modern theme (K2 5.9). If anybody else has solved this issue, would they be willing to share their script (or other approach)? Thanks in advance!

Best answer by TinTex

I have only done minimal testing, but ai provided:

<script>!function(e){var t=".grid-header-wrapper, .grid-header-text, .view-header, .panel-header, .panel-template-header";e(document).on("click",t,(function(c){var n=e(this).find("a.collapse-vertical, a.expand-vertical, a.collapse, a.expand");n.length&&!e(c.target).closest("a, button, input, select, textarea").length&&n.trigger("click")})),e("<style>").prop("type","text/css").html(t+" { cursor: pointer !important; user-select: none; }").appendTo("head")}(jQuery);</script>

5 replies

Forum|alt.badge.img+11
  • Nintex Employee
  • Answer
  • August 26, 2026

I have only done minimal testing, but ai provided:

<script>!function(e){var t=".grid-header-wrapper, .grid-header-text, .view-header, .panel-header, .panel-template-header";e(document).on("click",t,(function(c){var n=e(this).find("a.collapse-vertical, a.expand-vertical, a.collapse, a.expand");n.length&&!e(c.target).closest("a, button, input, select, textarea").length&&n.trigger("click")})),e("<style>").prop("type","text/css").html(t+" { cursor: pointer !important; user-select: none; }").appendTo("head")}(jQuery);</script>


ScottCaseIT
Nintex Partner
Forum|alt.badge.img+4
  • Nintex Partner
  • August 26, 2026

An alternative that would be more durable through upgrades, is just to address the issue directly, use a style profile to add your own CSS to make the button in question bigger. 


Forum|alt.badge.img+15
  • Author
  • Nintex Partner
  • August 26, 2026

@TinTex Thanks! That is what i was looking for. ​@ScottCaseIT  I agree, but at least my users seem to default to expecting that clicking anywhere on the bar will expand/collapse it. I’m sure this will have issues in future upgrades but since I put it in a shared style profile it will be just one place to fix it when it inevitably breaks.


ScottCaseIT
Nintex Partner
Forum|alt.badge.img+4
  • Nintex Partner
  • August 26, 2026

If you choose the JavaScript path, you might want to still consider the style profile for including the JavaScript as it would make it repeatable across forms by applying the profile.

 

https://help.nintex.com/en-US/k2cloud/userguide/update_18/Content/Create/StyleProfile/Developer.htm?tocpath=Create%7CK2%20Designer%7CSmartForms%7CStyle%20Profile%7CCreating%20a%20Style%20Profile%7C_____2


Forum|alt.badge.img+15
  • Author
  • Nintex Partner
  • August 26, 2026

Thanks ​@ScottCaseIT , that is exactly what I did.