Need to Create a Collapsible section in Widget

is_12
Tera Contributor

Hello,

Based on the checkbox selected on the portal, need to show collapsible section in the portal, Let say there are 3 checkbox, 1. ABC 2.DEF 3.GHI.

1 & 2 checkbox is true then related data should be visible in collapsible section.

 

I'm beginner in learning the portal, So Please Help me out.

 

Thanks in Advance !

 

 

6 REPLIES 6

RaghavSh
Mega Patron

@is_12 This should be simple javascript code.

 

Refer : https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_collapsible

 

If you are beginner, w3school example are good to start with.

 


Raghav
MVP 2023
LinkedIn

This is DOM manipulation and should be avoided to align with ServiceNow best practices.

@Mark_Branscombe This is portal widget we are not doing any manipulation to OOB components we are trying to build a new custom widget.

 


Raghav
MVP 2023
LinkedIn

Mark_Branscombe
Tera Expert

Some context around what you are trying to achieve and why would be useful.

Is this part of a catalog item for example, or are you building a custom widget from scratch?

 

UI policies and client scripts can be used if we're talking about a catalog item.

Functionality exists in Bootstrap to create expandable sections without requiring custom javascript if we're talking about a custom widget.