title: how to read Extjs dropdown value
body: <p>I've written a listener on a button action which adds a dynamic drop-down to my dialog —</p>
  
  <pre><code>name : './groupinfo' + count,
  id : 'groupinfo' + count,
  xtype : 'selection',
  type : 'select',
  emptyText:'Select a group...',
  options : '/bin/groupinfo/options.json', 
  fieldLabel : 'Group',
  width:200 
  </code></pre>
  
  <p><code>options.json</code> sends info in the following pattern — </p>
  
  <pre><code>[{"text":"Value1","value":"val1"},
   {"text":"Value2","value":"val2"},
   {"text":"Value3","value":"val3"}] 
  </code></pre>
  
  <p>and the drop-down values are showing properly. Now I want to read the selected value in my JS file, but the value is coming out as undefined. I've tried: </p>
  
  <pre><code>var dropdownVal = document.getElementById("groupinfo"+i).value;
  </code></pre>
  
  <p>Now, I have tried this which gives me blank value when I select — </p>
  
  <pre><code>var value1 = $('#groupinfo'+i+' option:selected').text(); 
  alert(value1);
  var value2 =  $('#groupinfo'+i).val(); 
  alert(value2);
  </code></pre>
  
  <p>When I tried to get the value from the dynamically created <em>text-box</em> then I can get the value by using <code>getElementById</code> but it is not working for the dynamically created drop-down. Please advise!</p>