datagrid easyui 資料下面新增合計列
阿新 • • 發佈:2019-02-14
onLoadSuccess: function (data) { var rows=$('#dg1').datagrid("getRows"); var tabid=$(".easyui-datagrid").attr("tabid"); //新增"合計"列 $('#dg1').datagrid('appendRow', { ADCD: '<span class="subtotal">合計</span>', BRCOUNT: '<span class="subtotal">' + compute("BRCOUNT") + '</span>', BSC: '<span class="subtotal">' + compute("BSC") + '</span>', BTC: '<span class="subtotal">' + compute("BTC") + '</span>', BXZCC: '<span class="subtotal">' + compute("BXZCC") + '</span>', CUCOUNT: '<span class="subtotal">' + compute("CUCOUNT") + '</span>', DACOUNT: '<span class="subtotal">' + compute("DACOUNT") + '</span>', DICOUNT: '<span class="subtotal">' + compute("DICOUNT") + '</span>', FLC: '<span class="subtotal">' + compute("FLC") + '</span>', FZQ: '<span class="subtotal">' + compute("FZQ") + '</span>', LDA: '<span class="subtotal">' + compute("LDA") + '</span>', LDAREA: '<span class="subtotal">' + compute("LDAREA") + '</span>', PCOUNT: '<span class="subtotal">' + compute("PCOUNT") + '</span>', PLA: '<span class="subtotal">' + compute("PLA") + '</span>', PT: '<span class="subtotal">' + compute("PT") + '</span>', PTCOUNT: '<span class="subtotal">' + compute("PTCOUNT") + '</span>', RSCOUNT: '<span class="subtotal">' + compute("RSCOUNT") + '</span>', SLCOUNT: '<span class="subtotal">' + compute("SLCOUNT") + '</span>', SRCOUNT: '<span class="subtotal">' + compute("SRCOUNT") + '</span>', STCOUNT: '<span class="subtotal">' + compute("STCOUNT") + '</span>', SWCOUNT: '<span class="subtotal">' + compute("SWCOUNT") + '</span>', TC: '<span class="subtotal">' + compute("TC") + '</span>', WBCOUNT: '<span class="subtotal">' + compute("WBCOUNT") + '</span>', XZCC: '<span class="subtotal">' + compute("XZCC") + '</span>', ZDFZQ: '<span class="subtotal">' + compute("ZDFZQ") + '</span>', ZRCC: '<span class="subtotal">' + compute("ZRCC") + '</span>', BZRCC: '<span class="subtotal">' + compute("BZRCC") + '</span>' }); var ro=$('#dg1').datagrid("getRows"); for (var i=0;i<ro.length;i++){ if(ro[i].PCOUNT=="<span class=\"subtotal\">NaN</span>"){ $('#dg1').datagrid('deleteRow',i); } } }