Hi,
I am using a Dijit.form.filteringSelect to display values using the dojox.data.QueryReadStore. But, after overriding _filterResponse() to format the data in a Dojo-parsable format, whatever value I select gets bypassed and the only value that gets selected is the the first one on the list. I am using the following code…please let me know if what I am missing here.
Thanks much in advance!
- <html>
-
<head>
-
<title>Autocomplete Test</title>
-
<style type="text/css">
-
@import "src/dijit/themes/tundra/tundra.css";
-
@import "src/dojo/resources/dojo.css";
-
</style>
-
<link rel="stylesheet" href="js/dojo/dijit/themes/tundra/tundra.css" />
-
<link rel="stylesheet" href="js/dojo/dojo/resources/dojo.css" />
-
<script type="text/javascript" src="js/dojo/dojo/dojo.js" djConfig="parseOnLoad:true, isDebug:true">
-
</script>
-
<script type="text/javascript" src="js/scripts.js">
-
</script>
-
<script type="text/javascript">
-
dojo.require("dojox.data.QueryReadStore");
-
dojo.require("dijit.form.FilteringSelect");
-
</script>
-
<script type="text/javascript">
-
-
dojo.addOnLoad(function(){
-
var countryStore = new dojox.data.QueryReadStore({
-
url: "http://localhost/url/",
-
jsId: "countryStore"
-
});
-
-
// for (var i in countryStore)
-
// alert(i.toString());
-
-
countryStore._filterResponse = function(data){
-
return {
-
identifier: "Country",
-
items: data
-
}
-
};
-
-
var co = new dijit.form.FilteringSelect({
-
name: "Countries",
-
autocomplete: false,
-
searchAttr: "Country",
-
store: countryStore
-
}, "fsPlaceHolder");
-
});
-
-
</script>
-
</head>
-
<body class="tundra">
-
Choose Country:
-
<div id="fsPlaceHolder">
-
</div>
-
</body>
-
</html>