ExtJs jsonStore加载的监听

 

var dataGrid = new Ext.grid.GridPanel({
    id                     : 'dataGrid',
    layout                 : 'fit',
    title:'合计 -账户余额:0.00元    可用余额:0.00元 冻结余额:0.00元',
    store                 : dataStore,
    autoScroll             : true,
    loadMask             : true,
    //sm                    : sm,
    columns             : getDataGridColumns(),
    bbar                 : getPbar(),
    viewConfig           : {
                          forceFit         : true,
                          showPreview      : true,
                          columnsText      : '显示列',
                          sortAscText      : '升序',
                          sortDescText     : '降序'
                          },
    emptyMsg             : "没有数据"
});

 

 

 

var totalStore = new Ext.data.JsonStore({
            url : GSC.context + "/spexmgr/finance/report/accountbalance/common/queryTotal.do",
            baseParams : {
                ajax : true,
                oper : 'list'
            },
            root : 'resultlist',
            totalProperty : 'rows_count',
            remoteSort : true,
            fields : ['sum_useablemoney_total', 'sum_avlb_fund', 'sum_frz_fund'],
            listeners : {
                load : function(store) {
                    var data = store.getAt(0).data;
                    // alert(data.sum_frz_fund);return;
                    var total_zh = 0.00;
                    var total_ke = 0.00;
                    var total_dj = 0.00;
                    if (data.sum_useablemoney_total != "") {
                        total_zh = data.sum_useablemoney_total;
                    }
                    if (data.sum_avlb_fund != "") {
                        total_ke = data.sum_avlb_fund;
                    }
                    if (data.sum_frz_fund != "") {
                        total_dj = data.sum_frz_fund;
                    }
                    dataGrid.setTitle('合计 -账户余额:<font color="red">'
                            + fmtMoney(total_zh * 0.01)
                            + '元    </font>&nbsp;可用余额:<font color="red">'
                            + fmtMoney(total_ke * 0.01)
                            + '元</font>&nbsp;冻结余额:<font color="red">'
                            + fmtMoney(total_dj * 0.01) + '元    </font>');

                }
            }
        });

 

posted @ 2015-09-12 14:46  mr_level  阅读(1138)  评论(0编辑  收藏  举报