[英]dojo: How to create two or more than two radio buttons in contentpane?
I am really new to dojo. 我真的很了解道场。 I have to create two or more that two Radio buttons using dojo content pane "Programmatic" not the "declarative".
我必须使用dojo内容窗格“ Programmatic”而不是“ declarative”来创建两个或两个以上的Radio按钮。
I manage to make one radio button but how to make another one, well I am embarrassed, Here I done for one; 我设法制作了一个单选按钮,但是如何制作另一个单选按钮,我很尴尬。
var radioButtonPane = new dijit.layout.ContentPane({
splitter:true,
region: "top",
style: "background-color: white;width: 175px; height: 40px",
content: "RadioButtons"
});
var radioOne = new dijit.form.RadioButton({
checked: true,
value: "ProjectOne",
name: "Project 1",
}, "radioOne");
//setting one radio button in content of contentpane, how add another one?
radioButtonPane.set('content',radioOne);
I should not make a "div" for it, 我不应该为此做一个“ div”,
I know its a very dumb question, Can anyone help? 我知道这是一个非常愚蠢的问题,任何人都可以帮忙吗? Thank you very much.
非常感谢你。
Let me answer in a proper form ; 让我以适当的形式回答; )
)
div
tag div
标签 I solved it with the help as per @h4b0 user's comments 我按照@ h4b0用户的评论通过帮助解决了
" it's not a problem, have you heard about dojo.create? dojotoolkit.org/reference-guide/1.7/dojo/create.html "
“这没问题,您听说过dojo.create吗? dojotoolkit.org/reference-guide/1.7/dojo/create.html “
I replaced my code with this; 我用这个替换了我的代码;
var radioOne = dojo.create("div", {
innerHTML:"<input type='radio' data-dojo-type='dijit.form.RadioButton' name='Project Cost' id='radioOne' value='Cost' checked: 'true'/>" + "<label for='radioOne'>Project Cost</label><br />"
+ "<input type='radio' data-dojo-type='dijit.form.RadioButton' name='Project Statistics' id='radioTwo' value='Project_Statistics' checked: 'true'/>" + "<label for='radioOne'>Project Statistics</label><br />"
+ "<input type='radio' data-dojo-type='dijit.form.RadioButton' name='Project Info' id='radioThree' value='Project_Info' checked: 'true'/>" + "<label for='radioOne'>Project Info</label><br />"
});
radioButtonPane.set('content',radioOne);
And its done what I needed. 它完成了我所需要的。 Thank you h4b0
谢谢h4b0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.