Skip to main content
Nintex Community Menu Bar
Solved

Expand/Collapse View - Click the Entire View Header Script

  • Aug 26, 2026 5:12 PM UTC
  • 5 replies
  • 119 views
  • Translate All

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>

View original

5 replies

Forum|alt.badge.img+11
  • Nintex Employee
  • Answer
  • Aug 26, 2026 6:02 PM UTC

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>

Translate

ScottCaseIT
Nintex Partner
Forum|alt.badge.img+5
  • Nintex Partner
  • Aug 26, 2026 6:38 PM UTC

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. 

Translate

Forum|alt.badge.img+15
  • Author
  • Nintex Partner
  • Aug 26, 2026 7:11 PM UTC

​@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.

Translate

ScottCaseIT
Nintex Partner
Forum|alt.badge.img+5
  • Nintex Partner
  • Aug 26, 2026 7:14 PM UTC

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

Translate

Forum|alt.badge.img+15
  • Author
  • Nintex Partner
  • Aug 26, 2026 7:20 PM UTC

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

Translate