Collapsible content within a DIV

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
kswisher
Profound User
Posts: 27
Joined: Fri Oct 23, 2015 9:51 am
First Name: Ken
Last Name: Swisher
Company Name: MHC
Contact:

Collapsible content within a DIV

Post by kswisher »

I am trying to find a way to implement collapsible content with a CSS panel. I am looking for something like bootstrap collapse ability.
https://www.w3schools.com/bootstrap/boo ... llapse.asp

A form will have multiple sets of radios buttons asking:
  • Did you perform this? Yes | NO
    Did you perform that? Yes | NO
    What about that other thing? Yes | No
For each question, if they select yes then there will be some additional information to be gathered for each one. That is where I would like to have the inputs dynamically show up. I would default these to collapsed on page load.

I have played around with changing the style.display property to "none" and "block", which essentially hides the content but the content below it does not move up.

Is there a way to accomplish this without manipulating every objects .top property?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Collapsible content within a DIV

Post by Scott Klement »

Since every widget has a fixed (absolute) position given with the top/left values, hiding previous elements isn't going to move anything.

You might consider writing HTML code yourself. (This can be embedded in a Rich Display with the HTML container). This way you can make everything "flow" within the container.
kswisher
Profound User
Posts: 27
Joined: Fri Oct 23, 2015 9:51 am
First Name: Ken
Last Name: Swisher
Company Name: MHC
Contact:

Re: Collapsible content within a DIV

Post by kswisher »

Ok, I had played around with bringing in Bootstrap and using an HTML layout.

If I go the HTML route, how do you bind the variables from the HTML inputs?

Do I have to have hidden controls to bind my variables and then use javascript to sync the HTML inputs to the hidden ones?

Or can I simply give it the same name on the input tag?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Collapsible content within a DIV

Post by Scott Klement »

You can't bind variables to a tag within an HTML container. And naming input tags the same as PUI variables will do nothing useful at all.

For data that's output from the program to the browser, you could use our ejs support.

You could also synchronize the data to hidden widgets using JavaScript -- that's probably the easiest. If you're driving this with an RPG program, you're going to need bound variables anyway, since you're going to want them in the DDS so that they're defined in the RPG program.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 6 guests