Connecting Tech Pros Worldwide Forums | Help | Site Map

Dojo + WCF) - Unable to retrieve selected value after overriding QueryReadStore’s _fi

Newbie
 
Join Date: Sep 2009
Posts: 1
#1: Sep 2 '09
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!
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <head>
  3.         <title>Autocomplete Test</title>
  4.         <style type="text/css">
  5.             @import "src/dijit/themes/tundra/tundra.css";
  6.             @import "src/dojo/resources/dojo.css";
  7.         </style>
  8.         <link rel="stylesheet" href="js/dojo/dijit/themes/tundra/tundra.css" />
  9.         <link rel="stylesheet" href="js/dojo/dojo/resources/dojo.css" />
  10.         <script type="text/javascript" src="js/dojo/dojo/dojo.js" djConfig="parseOnLoad:true, isDebug:true">
  11.         </script>
  12.         <script type="text/javascript" src="js/scripts.js">
  13.         </script>
  14.         <script type="text/javascript">
  15.             dojo.require("dojox.data.QueryReadStore");
  16.             dojo.require("dijit.form.FilteringSelect");
  17.         </script>
  18.         <script type="text/javascript">
  19.  
  20.             dojo.addOnLoad(function(){
  21.                 var countryStore = new dojox.data.QueryReadStore({
  22.                     url: "http://localhost/url/",
  23.                     jsId: "countryStore"
  24.                 });
  25.  
  26.                // for (var i in countryStore) 
  27.                    // alert(i.toString());
  28.  
  29.                 countryStore._filterResponse = function(data){
  30.                     return {
  31.                         identifier: "Country",
  32.                         items: data
  33.                     }
  34.                 };
  35.  
  36.                 var co = new dijit.form.FilteringSelect({
  37.                     name: "Countries",
  38.                     autocomplete: false,
  39.                     searchAttr: "Country",
  40.                     store: countryStore
  41.                 }, "fsPlaceHolder");
  42.             });
  43.  
  44.         </script>
  45.     </head>
  46.     <body class="tundra">
  47.         Choose Country: 
  48.         <div id="fsPlaceHolder">
  49.         </div>
  50.     </body>
  51. </html>

acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,589
#2: Sep 5 '09

re: Dojo + WCF) - Unable to retrieve selected value after overriding QueryReadStore’s _fi


Since I don't think anyone here uses Dojo, all I can offer you is this link.
Reply

Tags
dijit, dojo, filteringselect, javascript, queryreadstore