title: extjs 3.4 data not displaying from a popup grid to the main grid
body: <p>I have a grid in which I want to filter some results. For filtering the result a popup is opened and the user can select the search criteria and filter the results. The php file is executed as well as the result is returned to the popup, but it is not displaying in the main grid. Here is my code.
  This code displays the grid and is displaying the result when the user selects the radio button for filtering purpose :</p>
  
  <pre><code>var checkModel = new xg.CheckboxSelectionModel();
  
  var orderGridPanel = {
      id: 'orderGridPanel',
      xtype: 'editorgrid',
      title: 'Orders',
      height:350,
      clicksToEdit: 2,
      frame: true,
      viewConfig: {
          forceFit:true
      },
      cm: new xg.ColumnModel({
              defaults: {
                  width: 120,
                  sortable: true
              },
      columns: [
          {header:"nr",dataIndex:'nr',hidden:true}
          ,checkModel
          ,{header:"Order Id",dataIndex:'order'}
          ,{header:"Order Date",dataIndex:'date', renderer:Ext.util.Format.dateRenderer('m/d/Y')}
          ,{id:'created_by',header:"Order By",dataIndex:'created',align:'left'}
          ,{id:'order_type',header:"Order Source",dataIndex:'order',align:'left'}
          ,{header:"Order Type", dataIndex:'category'}
          ,{header:"Sub Category",dataIndex:'sub_cate_nm'}
          ,{header:"Item",dataIndex:'item'}
          ,{header:"Properties",dataIndex:'order'}
          ,{header:"Status",dataIndex:'order'}
          ,{header:"Action",renderer: renderViewResults}
  
  
      ]
       }),
      sm: checkModel,
      store: new Ext.data.Store({
          root: 'results',
          method: 'POST',
          autoSave: false,
          batch: true,
          proxy: new Ext.data.HttpProxy({
          api: {
              read:  'results.php?task=LISTING',
              create: 'results.php?task=CREATE',
              update:'results.php?task=UPDATE',
              destroy: 'results.php?task=DELETE'
          }
          }),
          writer: new Ext.data.JsonWriter({
              encode: true,
              writeAllFields: true,
              batch: true
          }),
          reader: new Ext.data.JsonReader({
              totalProperty: 'total',
              successProperty: 'success',
              idProperty: 'nr',
              root: 'results',
              fields: ['nr','order','date', 'created', 'type', 'category', 'sub_category_nm', 'item', 'properties', 'status']
          }),
          baseParams: ahist_order_params
      }),    
      bbar:[
      '-',{
          text: 'Add',
          iconCls: 'icon-add',
          handler: function(){
              editMoreData(0);
          }
      },
      '-', {
          text: 'Search',
          iconCls: 'icon-search',
          handler: function(){
              displaySearchFilter(origid);
          }
      },
  
      '-',{
          text: 'Sign Orders',
          iconCls: 'icon-warning',
          handler: function(){
              displaySearchFilter();
          }
      },
      '-',{
          text: 'Cancel',
          iconCls: 'icon-delete',
          handler: function(){
              displaySearchFilter();
          }
      },
  
      '-', {
          text: 'Refresh',
          iconCls: 'icon-table_refresh',
          handler: function(){
              Ext.getCmp('orderGridPanel').stopEditing(false);
              var rs = orderGridPanel.store.getModifiedRecords();
              if (rs.length &gt; 0) {
                  var status = window.confirm("Some data modified on grid, do you want to save grid data before loading latest data ?");
                  if (status){                  
                    orderGridPanel.store.save();
                  }
              }
               orderGridPanel.store.load();
          }
      },
      '-', {
          text: 'Print',
          iconCls: 'icon-print',
          handler: function(){
              statusStr = getHistGridSelection();
  
          }
      }
      ,'-&gt;'
      ,'Display:','-',
      {
          xtype: 'radio',
          name: 'search_filter',
          id:'search_filter_1',
          inputValue: 1,
          boxLabel: 'Open Orders',
          handler: onChangeLoadFilter ,
          checked : true 
      },'-',{
          xtype: 'radio',
          name: 'search_filter',
          id:'search_filter_2',
          inputValue: 2,
          boxLabel: 'All Orders',
          handler: onChangeLoadFilter
      },'-',{
          xtype: 'radio',
          name: 'search_filter',
          id:'search_filter_3',
          inputValue: 3,
          boxLabel: 'Orders 5 days back',
          handler: onChangeLoadFilter
      }
      ,'-',{
          xtype: 'radio',
          name: 'search_filter',
          id:'search_filter_4',
          inputValue: 4,
          boxLabel: 'Cancelled Orders',
          handler: onChangeLoadFilter
      }
  
  
  
  ]
  };
  </code></pre>
  
  <p>Now when I click on the search button this code executes:</p>
  
  <pre><code>function displaySearchFilter(id){    
  
      var formPanel = new Ext.FormPanel({
          frame: true,
          labelWidth:150,
          bodyStyle: 'padding:5px 5px 0',
          items: [{
              xtype: 'fieldset',
              defaultType: 'textfield',
              items: [
              {
            xtype       : 'container',
            border      : false,
            layout      : 'column',
            anchor      : '100%',
            style       : 'margin-top:8px;margin-bottom:8px;',
            defaultType : 'field',items :[
              {
                  xtype: 'label',
                  style: 'float: left; margin-left:3px;margin-top:3px;',
                  text: 'From'
  
              },
              {
                  fieldLabel: 'From Date',
                  xtype: 'datefield',
                  id: 'from_date',
                  style: "float: left; margin-left:3px;",
                  width:70
              },
              {
                  xtype: 'label',
                  style: 'float: left; margin-left:5px;margin-top:3px;',
                  text: 'To'
  
            },
              {
                  fieldLabel: 'To Date',
                  xtype: 'datefield',
                  id: 'to_date',
                  style: 'float: left; margin-left:5px;',
                  width:70
  
  
              },
              {
                  xtype: 'label',
                  style: 'float: left; margin-left:5px;margin-top:3px;',
                  text: 'Patient'
  
            },
              {
                  fieldLabel: 'Patient ID',
                  id:'patient',    
                  xtype: 'textfield',
                  style: 'float: left; margin-left:5px;',
                  value: btpacs.data.Origid,
                  mode:'local'
  
  
  
  
              },
  
              {
                  xtype:'label',
                  style:'float:left;margin-left:5px;margin-top:3px;',
                  text:'Display'
              },
  
  
  
              {
                  xtype:'combo',
                  id:'search_filter',
                  store:btpacs.data.searchFilter,
                  typeAhead: true,
                  mode: 'local',
                  triggerAction: 'all',
                  selectOnFocus: true,
                  lastQuery: '',        
                  emptyText:'Select an option...',
                  width : 120
              }
              ]},
              {
                  xtype: 'combo',
                  fieldLabel: 'Order Type',
                  name: 'category',
                  id:'cat',
                  store: btpacs.data.CpoeCategory,
                  hiddenName: 'category',
                  triggerAction: 'all',
                  emptyText:'Select an option...',
                  width : 300,
                  mode: 'local',
                  lastQuery: '',
                  listeners : {
                  select : function (f, e){
                      //params: { cat_id: Ext.getCmp('cat').getValue()}
                      //subCategoryStore.load();
                      var category_id = Ext.getCmp('cat').getValue();
                      subCategoryStore.reload({
                                  params: { cat_id: category_id}
                              });
                  }
              }
              },
              {
                  xtype: 'multiselect',
                  fieldLabel: 'Sub Category',
                  name: 'sub_category',
                  id:'sub_cat',
                  displayField: 'sub_cat_name',
                  valueField: 'sub_cat_id',
                  store: subCategoryStore,
                  hiddenName: 'sub_category',
                  emptyText:'Select Order Type First...',
                  triggerAction: 'all',
                  width : 300,
                  mode: 'local',
                  listeners : {
                  click : function (f, e){
  
                      var sub_cat_id = Ext.getCmp('sub_cat').getValue();
                      itemStore.reload({
                                  params: { sub_cat_ids: sub_cat_id}
                              });
                  }
              }
              },
              {
                  xtype: 'multiselect',
                  fieldLabel: 'Items',
                  name: 'items',
                  displayField: 'item_name',
                  valueField: 'item_id',
                  store:itemStore,
                  hiddenName: 'items',
                  triggerAction: 'all',
                  width : 300,
                  mode: 'local'
              },
              {                
                  xtype : "multiselect",
                  fieldLabel : "Doctor List",
                  id: 'placed_doctor_name',
                  displayField: 'name',
                  valueField: 'name',
                  typeAhead: true,
                  mode: 'local',
                  triggerAction: 'all',
                  selectOnFocus: true,
                  lastQuery: '',                    
                  store:doctorStore,
                  width : 300
              }]
          }],
          buttons: [{
              text: 'Search',handler: function() {
              formPanel.getForm().submit({
                  method: 'POST',
                  url: 'ajax/results.php?task=SEARCH', // when this file is executed the result is return properly as I want
                  root: 'results',
                  params : {'origid': origid},
                      success: function(f, a) {
                    // after the result is successfully returned I cannot display it here.I am not sure what I am missing.Here I want to assign all the result to orderGridPanel 
                      win.close(); 
                      },
                      failure: function(f, a) { 
                          alert("Request failed");
                          f.markInvalid(a.result.errors);
  
                      }  
                  });
              }
          },
          {
              text: 'Cancel',
              handler: function () {
                  win.close();
              }
          }]
      });
  
      win = new Ext.Window({
          layout: 'fit',
          width: 650,
          height: 520,
          defaults: {
              autoScroll: true
          },
          closeAction: 'close',
          title: 'Search Orders',
          plain: true,
          items: [formPanel]
      });
  
      win.show();
  
  
  }
  </code></pre>
  
  <p>Thanks in advance.</p>