Bootstrap-table底部求和 fastadmin表格底部求和

helei 2021-12-3 1,262 12/3
 Table.api.init({
                showFooter: true,//添加这个
                extend: {
                    index_url: 'order/index' + location.search,
                    add_url: 'order/add',
                    edit_url: 'order/edit',
                    del_url: 'order/del',
                    multi_url: 'order/multi',
                    import_url: 'order/import',
                    table: 'order',
                }
            });

列里面添加

footerFormatter: function (value) {
                                            var count  = 0; 
                                            value.forEach(function(e){
                                                count = count+parseInt(e.true_money)
                                            })
                                            console.log(count)
                                            return "总金额"+count.toString();//保留两位小数
                                        },

- THE END -

helei

12月03日17:18

最后修改:2021年12月3日
0

非特殊说明,本博所有文章均为博主原创。