title: Dojo FilteringSelect load data
body: <p>I have the following code below, which will create a <strong>FilteringSelect</strong> and set the first selected item:</p>
  
  <pre class="lang-js prettyprint-override"><code>// Store initialization:
  var jsonStore = custom.store.JsonRest({ ... });
  var memoryStore = dojo.store.Memory();
  var myStore = dojo.store.Cache( jsonStore, memoryStore);
  var dataStore = custom.store.MyObjStore({ objectStore: myStore, ...  });
  
  // FilteringSelect initialization:
  var fsel = new dijit.form.FilteringSelect({
               id: 'fsel',
               searchAttr: 'id',
               store: dataStore
             });
  
  // Setting the first item on FilteringSelect, retrieved from store objects
  fsel.store.fetch({ query: {id:""},
    onComplete: function (items, request) {
      var val = "";
      if (items.length&gt;0) val = items[0].id;
      fsel.set('value', val);
    }
  });
  </code></pre>
  
  <ol>
  <li><p>First problem is that, if the <code>items[0].id = 0</code>, this item is not set on FilteringSelect.</p></li>
  <li><p><code>fsel.store.fetch({ ... })</code> queries the server, which is ok. The problem is that the retrieved items are not kept in memory, or they are, but are not retrieved by FilteringSelect on the next event.
  I mean, when I click the first time on FilteringSelect's dropdown another query is sent to server to get the items, the following times they get from memory.</p></li>
  </ol>
  
  <p>Could anyone help me to solve these two problems?</p>
  
  <p>Note: I'm using Dojo version 1.7.2 (27913).</p>