#14348 closed defect (invalid)
Set ComboBox.store programmatically fails
Reported by: | maceto | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Dijit - Form | Version: | 1.7.0 |
Keywords: | set ComboBox.store programmatically | Cc: | |
Blocked By: | Blocking: |
Description
HTML
<input dojoType="dijit.form.ComboBox?" name="state" id="state" autoComplete="true" required="true" onchange="LoadCities?"</input>
Code
function LoadCities?(newValue) {
checkLoadAddrDijits(); jsonDSUF1.fetch({
queryOptions: {ignoreCase: true}, query: {name: newValue}, onItem: function (item, request) {
LoadJSON_DS_City(item.uf);
fCity.store = jsonDSCity; fCity.searchAttr = "name";
}
});
}
Where jsonDSCity is a dojo.data.ItemFileReadStore? type.
OBS
This code works perfectly in version 1.6.0 and 1.6.1!
Change History (5)
comment:1 Changed 9 years ago by
comment:2 follow-up: 4 Changed 9 years ago by
Priority: | high → normal |
---|---|
severity: | critical → normal |
did you try fCity.set('store', jsonDSCity);
like you should be doing when setting widget properties? same for searchAttr
. setting the property directly works in some cases but if you want your code to stay compatible with future versions, use set
and get
.
btw, this is not to say that using set
will definitely work for you but this isn't a bug unless using set
doesn't work.
comment:3 follow-up: 5 Changed 9 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Presumably it's what neonstalwart said. In the future please attach test cases using the "attach file" button rather than inlining code snippets into the ticket. And also, read the release notes, as this kind of thing is documented.
comment:4 Changed 9 years ago by
Replying to neonstalwart:
did you try
fCity.set('store', jsonDSCity);
like you should be doing when setting widget properties? same forsearchAttr
. setting the property directly works in some cases but if you want your code to stay compatible with future versions, useset
andget
.btw, this is not to say that using
set
will definitely work for you but this isn't a bug unless usingset
doesn't work.
Thanks,
I made the changes you suggested. It worked perfectly.
comment:5 Changed 9 years ago by
Replying to bill:
Presumably it's what neonstalwart said. In the future please attach test cases using the "attach file" button rather than inlining code snippets into the ticket. And also, read the release notes, as this kind of thing is documented.
Ok, Thanks.
HTML
<input dojoType="dijit.form.ComboBox?" name="state" id="state" autoComplete="true" required="true" onchange="LoadCities?"</input>
<input dojoType="dijit.form.ComboBox?" name="city" id="city" autoComplete="true" required="true"</input></td>
Code
function checkLoadAddrDijits() {
}
function LoadCities?(newValue) {
}
Where jsonDSCity is a dojo.data.ItemFileReadStore? type.
OBS
This code works perfectly in version 1.6.0 and 1.6.1!