Your first problem, with the prepare_str()
function not being called is due to a scoping issue. When you rely on a callback, then this
will no longer refer to your class. To solve that you could use the hitch()
method of the dojo/_base/lang module, for example:
xhr("sqlaccess.php?order=0").then(lang.hitch(this, function(text){
this.prepare_str(text.toString().split(";"));
}));
This makes sure that the callback of the xhr()
function will use the current object as scope and so this
will refer to your class (which contains the prepare_str()
function).
I'm not sure why your combobox is not working though. Make sure the module is being loaded correctly and also note that in your constructor of your myComboBox
you should not forget to use the this
.
this.comboBox = new ComboBox({
id: "stateSelect",
name: "state",
value: "",
store: stateStore,
searchAttr: "name"
}, "stateSelect");
If you want further help with your constructor problem, you should try to make a screenshot of the console where your error is or at least give the full stacktrace of the error (I'm assuming it's located at the new ComboBox()
statement, but I want to be sure.