3
A
回答
0
有。我能夠使用在增加的dijit的創作.placeAt()方法,它做的事情,比如下面:
在index.htm的
<div id="divMap"></div>
在main.js回調中
ready (function() {
var ttpMyTitlePane = new TitlePane({
title: 'My Title'
});
divMenu.appendChild(ttpMyTitlePane.domNode);
var btnMyButton = new Button({
label: 'ButtonText',
onClick: function() {
// do stuff
}
}).placeAt(ttpMyTitlePane.domNode);
}
1
的dijit TitlePane頭包含以下
<div class="dijitTitlePaneTitleFocus" data-dojo-attach-point="focusNode" aria-pressed="true" role="button" aria-controls="dijit_TitlePane_0_pane" tabindex="0">
<span data-dojo-attach-point="arrowNode" class="dijitInline dijitArrowNode" role="presentation"></span><span data-dojo-attach-point="arrowNodeInner" class="dijitArrowNodeInner">-</span><span data-dojo-attach-point="titleNode" class="dijitTitlePaneTextNode" style="user-select: none;">Rule</span>
<span class="dijit dijitReset dijitInline dijitButton" role="presentation" widgetid="dijit_form_Button_1">
<span class="dijitReset dijitInline dijitButtonNode" data-dojo-attach-event="ondijitclick:__onClick" role="presentation">
<span class="dijitReset dijitStretch dijitButtonContents" data-dojo-attach-point="titleNode,focusNode" role="button" aria-labelledby="dijit_form_Button_1_label" tabindex="0" id="dijit_form_Button_1" style="user-select: none;">
<span class="dijitReset dijitInline dijitIcon dijitNoIcon" data-dojo-attach-point="iconNode"></span><span class="dijitReset dijitToggleButtonIconChar"></span>
<span class="dijitReset dijitInline dijitButtonText" id="dijit_form_Button_1_label" data-dojo-attach-point="containerNode">x</span></span></span></span>
</div>
正如你看到有幾個連接點,我們可以參考。
添加任何物品,甚至dijit的或自定義窗口小部件執行以下操作來放置物品後,最後在focusNode連接點(注:你必須正確地設置樣式,以便項目出現在位置,你想)
var myTitlePane = new TitlePane({ title: "TitlePane" });
var deleteButton = new Button({
label: 'x',
onClick: function() {
//do something here like delete the titlepane
//alert();
}
});
deleteButton.placeAt(rulesTitlePane.focusNode);
這會產生一種看起來像這樣,
或者你可以取代一切,創造一切你想要個e focusNode。
相關問題
- 1. 添加按鈕道場的DataGrid
- 2. 道場:添加一個按鈕動態
- 3. 如何自定義圖像添加到按鈕(道場1.7)
- 4. 道場對不捉TitlePane觸發事件
- 5. 道場按鈕例如
- 6. 道場附加按鈕像jQuery
- 7. 在TitlePane中添加內容
- 8. 如何使添加按鈕
- 9. 無法從按鈕從模板道場
- 10. 道場按鈕沒有被禁用
- 11. 道場解析器改變按鈕ID
- 12. 如何添加在劍道一個按鈕彈出
- 13. 不知道如何添加按鈕陣列 - java
- 14. 如何使我的提交按鈕主題,春道場
- 15. 添加按鈕
- 16. 添加按鈕
- 17. 添加按鈕
- 18. 添加按鈕
- 19. 添加按鈕
- 20. jQuery:如何添加按鈕,可以依次添加更多按鈕
- 21. 如何添加按鈕轉到Instagram?
- 22. android:如何添加圖片按鈕?
- 23. 如何添加按鈕在儀表板
- 24. 如何添加按鈕到導航欄?
- 25. 如何添加一個按鈕到CGridView?
- 26. 如何MouseDown事件添加到按鈕
- 27. 如何動態添加按鈕到TCategoryPanelGroup?
- 28. 如何在android中添加按鈕?
- 29. 如何爲android按鈕添加陰影
- 30. 如何將文本添加到按鈕?
在文檔中,你可以提供dijit的小部件TitlePane的內容。 – springrolls 2013-03-04 14:52:43
我相信,TitlePane小部件可以擴展。 – undefined 2013-03-04 20:44:28
你是否得到了這個問題的答案?是否沒有屬性可用於聲明窗體將內容添加到titlePane中? – noobcode 2015-06-16 04:51:03