如何使用javascript在特定的contentpane中放置Dijit组合框
我试图创建一个数据存储来填充一个组合框,看起来一切正常,但是我的组合框没有显示在我想要的地方,实际上它没有显示在任何地方 我正在尝试这样的东西如何使用javascript在特定的contentpane中放置Dijit组合框,javascript,dojo,Javascript,Dojo,我试图创建一个数据存储来填充一个组合框,看起来一切正常,但是我的组合框没有显示在我想要的地方,实际上它没有显示在任何地方 我正在尝试这样的东西 //this is the content pane where i want the combobox var tab = new dijit.layout.ContentPane({ title: "tab", style:"width:100%; height:500px", conten
//this is the content pane where i want the combobox
var tab = new dijit.layout.ContentPane({
title: "tab",
style:"width:100%; height:500px",
content: "Here goes the comobox",
});
tab_container.addChild(tab);
// this is the combobox and store created
Types = function() {
dojo.xhrGet
({url:"json/types.json",
handleAs: "json",
load: function(types, details) {
PropertyMap.TypeStore = new dojo.data.ItemFileReadStore({
data : {
identifier: 'id',
label: 'display',
items : types
}
});
},
error: function(error_msg, details) {
content.handleError(error_msg, details);
}});
};
XXX.createPlaceTypeStore = function(types) {
var PlaceTypeStore = new dojo.data.ItemFileReadStore({
data:{
identifier:"id",
label:"display",
items:types
}
});
var combo_box = new dijit.form.ComboBox({
name : "options",
placeHolder:"options place",
value:"",
store: PlaceTypeStore,
searchAttr:"display"
});
combo_box.placeAt("tab");
// i am getting this error
refNode is null
[Break On This Error]
if(has("dojo-combo-api")){
你启动ContentPane和ComboBox了吗?即使我在一个MainFunction中创建了整个东西,我也必须这样做吗。我在index.html`dojo.addOnLoad函数{``main function.initialise;`}中执行此操作//我的javascript在MainFunction.initialise=function{其他所有内容都在这里}是的,如果以编程方式创建小部件,则必须对其调用startup以完成其初始化。解决了,这是我创建的组合框的问题。我创建它的方式是,创建了一个在其他任何地方都不允许使用的框的局部变量,我在创建容器的函数下创建了它,它工作得很好,但现在,我有了this.fetch不是函数的错误