문제
Div의 끝까지 Dijit을 만들고 추가하는 방법이 있습니까? 다음 코드가 있다고 말합니다.
<div id="attendants">
</div>
<button dojoType="dijit.form.Button" onClick="addPerson();">Add Person</button>
온라인으로 다음 코드를 찾았지만이 코드는 내 '승무원'DIV를 대체합니다.
var personCount = 0;
function addPerson() {
personCount += 1;
var attendants = dojo.byId('attendants');
var newField = new dijit.form.TextBox({id: 'newPerson' + personCount, name: 'newPerson' + personCount}, attendants);
}
그리고 DIV를 DIJIT로 바꾸지 말고 DIV에 새로운 TextBox Dijit을 동적으로 추가하고 싶습니다.
해결책
// place a new button as the first element of some div
var button = new dijit.form.Button({ label:"click" }).placeAt("wrapper","first");
제휴하지 않습니다 StackOverflow