2011-10-28 32 views
1

我有一個容器元素,我在其中創建/ place()表單,然後另一個..等等。 我的目標是在它們之間切換,即全部隱藏並僅顯示活動表單。 它隱藏好了,但我不能顯示活動回來。Dojo:顯示()和隱藏()....如何?

我試着使用:

  1. .style.display(無< - >塊)和能見度(能見度< - >隱藏)
  2. dojo.style(...)
  3. 調整大小( )和啓動()的變化
  4. 其他幾個變種我從老道場的

沒有什麼工作上網後發現。 /我需要用它來顯示工作,所以它不會佔用space./

你能告訴我什麼是展示與道場()

又看了看這一個隱藏的正確方法: How do I dynamically show and hide an entire TabContainer using DOJO?

不起作用。

我使用的僞代碼是這樣的: ....

//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() 

感謝名單

回答

0

我剛剛在幾分鐘前在您的問題中引用的那個線索中回答了問題。基本上涉及到涉及jQuery。對我很好。我有靜態創建的所有選項卡(而不是編程),我可以通過jQuery的幫助來操作它們是顯示還是隱藏。所有代碼的任何一切都在我的崗位在這裏:

How do I dynamically show and hide an entire TabContainer using DOJO?

0

聽起來像是你可能會尋找StackContainer功能。

只需設置事件,以便StackContainer將dijit.form.Forms作爲子對象使用,並且您可以使用selectChild方法來選擇要顯示的表單。

+0

感謝名單會嘗試, – user1019129