마크 업 선언 된 dijit.form.Select 위젯에 대한 옵션을 JSON 선언을 통해 선언하려고합니다. API 문서에서 읽은 바를 토대로하면 setStore()를 사용하여 새 저장소를 전달한 다음 업데이트해야하지만 전체 저장소가있는 빈 Select 위젯 외에 유용한 결과가 생성되지 않은 것으로 보입니다. 잘못된 메서드를 사용하고 있거나 이러한 옵션을 선언하는 다른 방법이있는 경우 내 개체에서 누락 된 선언이 있는지 궁금합니다. 난 당신이 상점을 놓치 초기화하는 생각dijit.form.select의 값을 프로그램 적으로 선언하기
<!DOCTYPE HTML>
<html dir="ltr">
<head>
<style type="text/css">
body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js"
djConfig="parseOnLoad: true">
</script>
<script>
dojo.require("dijit.form.Select");
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("dojo.data.ItemFileWriteStore");
</script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css" />
</head>
<body class=" claro ">
<div class="option" id="option" dojoType="dijit.form.Select"></div>
<script type="text/javascript">
dojo.addOnLoad(function() {
if (document.pub) {
document.pub();
}
var selectOptions = {
name:'selection',
identifier: 'label',
options: [{
label: 'this',
value: '01'
},
{
label: 'that',
value: '02'
},
{
label: 'the other',
value: '03'
},
{
label: 'banana',
value: '04',
},
]};
var aStore = dojo.data.ItemFileReadStore({data: selectOptions});
dijit.byId("option").setStore(aStore, 01);
dijit.byId("option").startup();
});
</script>
</body>
</html>
이 내가 사용하는 결국 궁극적 것입니다. 감사. –