当我尝试设置我的商店提供的 dijit/form/Select 小部件的预选(或任何)值时,还有另一个问题。
标记代码是:
<div data-dojo-type="dijit/form/Select" jsId="editOptionsDialog_select" id="editOptionsDialog_select"></div>
和js:
function editOptionsDialog_fetchData(cId, fieldName, vId) {
var store;
var def;
var return_def = new Deferred();
store = new degreeStore();
def = store.getJsonData();
def.then(function(data) {
store.data = data.items;
editOptionsDialog_select.setStore(new ObjectStore({
objectStore : store
}));
editOptionsDialog_select.value = vId;
editOptionsDialog_select.startup();
editOptionsDialog_select.set('value', 5);
console.info(editOptionsDialog_select);
// here, firebug still shows value = 1
return_def.resolve();
});
return return_def;
}
提前谢谢
问候