title: Dojo - how to setup my JSON to populate another dijit.form.ComboBox wiht a preset of values
body: <p>Here's an example:</p>
  
  <p>I wanted to set up my JSON so it can have a list of countries corresponds to a list of states
  (1) First I am setting up the storeData.  This is where I am having trouble.  How do I set up so that I can have a combo box of countries like the example below and another combobox that would have a pre-set of values based on selection of the country: for example:  if user selects 'United States' from the combo box, the 2nd combobox should have a list of 'Texas' and 'California'</p>
  
  <pre><code>&lt;script type="text/javascript&gt;
  dojo.require("dojo.data.ItemFileReadStore");
  dojo.require("dijit.form.ComboBox");
  
  var storeData = { identifier: 'name',
  items: [
  { name: 'United States', state: ['Texas', 'California'] },
  { name: 'Canada', state: ['Alberta', 'Quebec'] }
  ]};
  
  //
  function init(){
   // Function to perform a lookup on the datastore on each change event of the combo  
      function getItemFromStore(){
      function lookUpState(item, request){
         var lNode = dijit.byId("country");
  
         if(!item){
             lNode.setDisplayedValue("");
  
         }else{
             //set up the pre-select list of states
             //logic goes here
  
         }
      }
   //invoke the lookup
      country.fetchItemByIdentity({identity: combo.getValue(), onItem: lookUpState});
      }
   // Link any change events in the combo to driving the fetchItemByIdentity lookup.
    dojo.connect(combo, "onChange", getItemFromStore);
    }
   // Set the init function to run when dojo loading and page parsing has completed.
   dojo.ready(init);
   &lt;/script&gt;
  
   //HTML
   &lt;div data-dojo-type="dojo.data.ItemFileReadStore" 
   data-dojo- props="data:storeData"     data-dojo-id="country"&gt;&lt;/div&gt;
   &lt;div data-dojo-type="dijit.form.ComboBox" data-dojo-props=
   "store:country, searchAttr:'name'" data-dojo-id="combo"&gt;&lt;/div&gt;
  
  &lt;div class="formRow"&gt;
  &lt;label for="TestBox"&gt;State&lt;/label&gt;
  &lt;input dojoType="dijit.form.ComboBox" name="state" id="state" /&gt;
  &lt;/div&gt;
  </code></pre>