- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2016 11:14 AM
UI policy actions and "setDisplay()" are only effective at filling empty space vertically, not horizontally
Example, if I have two variables in a 2 column container:
[ a ] [ b ]
If I use setDisplay to hide "a", "b" will remain in it's place.
[ b ]
If I have four variables:
[ a ] [ b ]
[ c ] [ d ]
it will fill from the bottom, completely ruining any organization.
[ c ] [ b ]
[ d ]
Short of DOM manipulation.. is there a way to alter the collapse behavior?
Thanks,
-Stephen
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2016 02:57 PM
This is where careful layout design comes in. For best user experience, keep your show/hide fields either directly under or to the right of the static fields.
E.g. Choose one option and it 'turns on' several other fields below or to the right.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2016 11:16 AM
Use g_form.setVisible() in your client script (or a UI policy)
Docs: GlideAjax
Client Script Best Practices - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2016 11:20 AM
Er, perhaps I was unclear..
I would like:
[ a ] [ b ]
to become
[ b ]
setVisible() doesn't reclaim whitespace at all.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2016 11:22 AM
Do you have a screenshot. I'm not understanding what this is looking like. Are you looking to collapse/hide an entire container from the left side of the screen and have the elements on the right shift to the left? Again, a screenshot is worth 1,000 words.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2016 02:45 PM