title: In ExtJS, how to define jsonreader for different json input formats?
body: <p>I have an external source that generates JSON in given format. I need to use ScriptTagProxy to access that data. Format of data is (two records):</p>
  
  <pre><code>{
  "COLUMNS":["KEDBID","EMPID","KE","SOLUTION","ATTACH_KE","ATTACH_SOLUTION"],
  "DATA":[
  [1,36661,"While adding a new user, if his\/her profile is missing, it could be LDAP    server issue.","Contact Mr. ABC from infra team to get user's profile corrected on server","screenshots.jpg","conacts.doc"],
  [2,36661,"The error code # 123445 is trivial that may occur at particular time.","To resolve this issue, we will need to ask DBA team to refresh database. That will fix this type of errors","NA","NA"]
  ]
  } 
  </code></pre>
  
  <p>How to define jsonreader for this data? As i have seen that root should be like:</p>
  
  <pre><code>{ROOT: [ {field1:data1,field2:data1},{field1:data2,field2:data2}]}
  </code></pre>
  
  <p>while my JSON is like:</p>
  
  <pre><code>{fieldnames:['field1','field2'],
   ROOT:[ [data1ForField1,data1ForField2],[data2ForField1,data2ForField2] ]
  }
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Adding one more case:
  Similarly can we have a jsonreader for;</p>
  
  <pre><code>    {"ROWCOUNT":8,
  "COLUMNS":["CATID","CATEGORY"],
  "DATA":{"CATID":[1,2,3,4,5,6,7,8],"CATEGORY":["Optimization","Automation","Process Improvement","Tool","Other","Another One","ThisHas'","More^!@#(){}"]}} 
  </code></pre>
  
  <p>where 1-->Optimization, 2-->Automation, 3-->Process Improvement etc.</p>
  
  <p>Basically I need to return data from ColdFusion query object by serializing query object. Serialization in CF Query can return data in above two formats.</p>
  
  <p>I'm still new to Ext World!! Hope to get some support.</p>
  
  <p>Best Regards,
  Tushar Saxena</p>
  
  <hr>
  
  <p>Below is the code where I'm facing issue. The data is being coming up in store as it is available to ComBox.. but not able to read data using each function or by other means? So is it that Data in store can only be fed to components? In another example I created a simplestore (ArrayStore) paased data manually using loadDATA().. there each function was working!!!</p>
  
  <p>In below case to if I add one record after load using ADD(), each function would get executed one time showing data that I just added... and that just added data is not available to components!!! How come!!!</p>
  
  <p>May be I'm missing some very basic concept as I'm still very new to EXT.</p>
  
  <p>Would be really greatful for response. </p>
  
  <pre><code>var proxy = new Ext.data.ScriptTagProxy({
              url: 'http://127.0.0.1:8500/extex/kebyid.cfm',
              method: 'POST'
          });
  
          var rec = Ext.data.Record.create([
              {name: 'EMPID', mapping: 1},
                       {name: 'KE', mapping: 2},
                       {name: 'SOLUTION', mapping: 3},
                       {name: 'ATTACH_KE', mapping: 4},
                       {name: 'ATTACH_SOLUTION', mapping: 5}
          ]);
  
          var myReader = new Ext.data.ArrayReader({
                      idIndex: 0,
                      root: 'DATA'
                  }, rec);
  
  
  
          var store = new Ext.data.ArrayStore({
                   proxy: new Ext.data.HttpProxy({
                          url: '/extex/kebyid.cfm',
                              method: 'POST'
                  }),
  
                  autoSave: true,
                  autoLoad: true,
                  root: 'DATA',
                  fields: [
                       {name: 'KEID', mapping: 0},
                       {name: 'EMPID', mapping: 1},
                       {name: 'KE', mapping: 2},
                       {name: 'SOLUTION', mapping: 3},
                       {name: 'ATTACH_KE', mapping: 4},
                       {name: 'ATTACH_SOLUTION', mapping: 5}
                  ]
              });
  
  
      store.each(function(){
          alert('!!!!'); //**************NOT WORKING
      });
      var catCB = new Ext.form.ComboBox({
              fieldLabel: 'Category',
              layout:'absolute',
              x: 100,
               y: 5,
              store: store, //************* DATA IS THERE AS STORE IS PROVIDING DATA TO COMBOBOX
              emptyText:'Select Category...',
              valueField : 'KEID',
              displayField : 'KE',
              hiddenName : 'category',
              hiddenvalue : 'None', 
              mode: 'local',
              editable : false,
              lastQuery: '',
              renderTo: Ext.get("d1"),
              listeners: {
  
                  'beforequery': function(qe){
                        qe.forceAll = true;
                  }}
          });
  </code></pre>