I have a container element in which I create on the fly/place() a form, then another one..etc. My goal is to switch between them i.e. hide all and show only the active form. It hides alright, but I can't show the active back.
I tried using:
- .style.display(none<->block) and visibility(visibility<->hidden)
- dojo.style(...)
- resize() and startup() after the changes
- Several other variants i found on Internet from old dojo's
Nothing works. /I need it to work with display, so that it does not occupy space./
Can you tell me what is the correct way to show and hide with dojo()
Also looked at this one : How do I dynamically show and hide an entire TabContainer using DOJO?
Does not work.
The pseudo code I use is something like this : ....
//find or create the FORM element
form = dijit.byId(...);
if(typeof form != 'object') {
form = dojo.create('form', ....);
dojo.place(form,'containerx','last');
}
//hide all
dojo.query('#containerx > *').forEach(function(item){
dojo.style(item, 'visibility','hidden');// and all other variants i mentioned
})
//show only the current form
dojo.style(form, 'visibility','visible');
//if the dojo form obj was already created, then skip it
if (this.form_obj) return;
....build the form and the elements....
this.form_obj.startup()
thanx