Ext.store.load callback

时间:2022-05-05 08:00:20

var paramsReceivable = {};
                paramsReceivable.querytext = Ext.getCmp('hiddquerytext').getValue();
                gridReceivable.store.load({
                    params: paramsReceivable,
                    callback: function (r, options, success) {
                        var heji = 0;
                        for (var i = 0; i < r.length; i++) {
                            var record = r[i];
                            heji += record.data.heji;
                        }
                        Ext.getCmp('lblheji').setText(heji);

//Math.round(heji)//四舍五入
                        //Math.floor(heji)//取整数
                        Ext.getCmp('lblheji').setText("¥"+heji.toFixed(2));
                }
                });