Hide Select2

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
bescott53

Hide Select2

Post by bescott53 » 2020-03-26 14:02

Hi board, I have 10 fields (select2) I want to hide them when the page is opened if they are empty (except the first one). If there is data in the first one then I want to show the next one automatically and so on. Is this possible

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Hide Select2

Post by pbottcher » 2020-03-26 19:07

Hi,

I think that is doable, I guess you only want to have it for new records.
I did not try that, but I would assume that one option could be:
if you create a new record, check of the existence of an ID, if no ID exists, you create a new record

1, you need to wait till the select2 are created and hide them (except the first one)
2, you register for a change event on each of the select2. Once the select2 change event is fired, you check the actual value. If it is not empty, you show the next select2.

Not sure how you want to handle the case when the user entered already data in let say box 1,2,3 and now clears box 2, so what shall happen to box 3 and 4.

Hope that gives you a starting point
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply