2014-02-26 84 views
0

我有,當我試圖刷新從ExtJS的WindowsB一個ExtJS的WindowsA內網的商店有問題的商店..這裏是代碼EXTJS無法刷新網格

有一個網格內我WindowsA與這家商店的

var store_grid_egresos_fijos = Ext.create('Ext.data.Store', { 
    fields: [ 
     {name: 'concepto_egreso.id', type: 'int'}, 
     {name: 'tipo', type: 'string'}, 
     {name: 'concepto_egreso.nombre', type: 'string'}, 
     {name: 'monto', type: 'numeric'}, 
     {name: 'fecha', type: 'date', dateFormat: 'Y-m-d'}, 
     {name: 'referencia_documento_mercantil', type: 'string'}, 
     {name: 'nro_factura', type: 'string'}, 
     {name: 'cuenta.nombre', type: 'numeric'} 

    ], 
    proxy: { 
     type: 'ajax', 
     url: '/egreso/egresos_by_date', 
     reader: { 
      type: 'json' 
     } 
    }, 
    autoLoad: false 
}); 

,這裏是我的WindowsA.js內部網格代碼:

{ 
        xtype: 'gridpanel', 
        id:'egresosGridFijos', 
        store: store_grid_egresos_fijos, 
        features :{ftype:'summary'}, 
        x: 10, 
        y: 50, 
        height: 310, 
        maxHeight: 310, 
        width: 350, 
        title: 'Gastos Fijos', 
        columns: [ 
         { 
          xtype: 'gridcolumn', 
          width: 44, 
          dataIndex: 'concepto_egreso.id', 
          text: 'ID' 
         }, 
         { 
          xtype: 'gridcolumn', 
          width: 219, 
          dataIndex: 'concepto_egreso.nombre', 
          text: 'Concepto' 
         }, 
         { 
          xtype: 'numbercolumn', 
          width: 78, 
          text: 'Monto', 
          dataIndex: 'monto', 
          summaryType: 'sum', 
          summaryRenderer: function change(val){ 
           total_fijos = val 
           return '<span style="color:green;">' + val + '</span>'; 
          } 

         } 
        ] 
} 

這裏是我嘗試更新中對電網的存儲代碼WindowsA.js(這個代碼裏面WindowsB.js)

{ 
        xtype: 'button', 
        id:'btn_registrar_obj_egreso', 
        x: 785, 
        y: 370, 
        width: 105, 
        glyph: 20, 
        cls: 'my-button', 
        scale: 'medium', 
        text: 'Registrar', 
        icon:'/images/grabar.png', 
        handler: function(){ 

         Ext.Ajax.request({ 
          url: '/egreso/registrar', 
          method: 'GET', 
          params: { 
           condominios_id: 01, 
           concepto_egreso_id: Ext.getCmp('txt_id').getValue(), 
           fecha : Ext.getCmp('dt_fecha').getValue(), 
          }, 
          success: function(resultado, request) { 
           datos=Ext.JSON.decode(resultado.responseText); 

           if (datos.success) { 
            var mes = Ext.getCmp('txt_mes').getValue() 
            var year = Ext.getCmp('txt_year').getValue() 
            var fecha = year+'-'+mes+'-'+'05' 
            Ext.getCmp('dt_fecha_consulta').setValue(fecha) 

            store_grid_egresos_fijos.load({ 
             params : { 
              fecha : fecha, 
              tipo:'fijo' 
             }, 
             autoLoad: true 
            }); 

            Ext.Msg.show({ 
             title:'SIACO', 
             msg: datos.msg 

            }); 


           } 
           else { 
            Ext.Msg.alert("Error", datos.msg); 

           } 

           ; 
          }, 
          failure: function(response) { 
           alert("Error " + response.responseText); 
          } 
         }) 

        } 

       } 

有了這個代碼,我試圖新網格...重裝

store_grid_egresos_fijos.load({ 
              params : { 
               fecha : fecha, 
               tipo:'fijo' 
              }, 
              autoLoad: true 
             }); 

回答

0

嘗試重裝店這樣

store_grid_egresos_fijos.baseParams.fecha = fecha; 
store_grid_egresos_fijos.baseParams.tipo = 'fijo'; 
store_grid_egresos_fijos.reload();