Searcher.create(‘#invoiceGrid‘列表下小三角 显示明细 和统计金额

 
    var searcher = Searcher.create('#invoiceGrid', [
            {name: 'id', hidden: true}, 
             {
                label: "发票日期",
                name: "invDate",
                index: "invDate",
                width: 100,
                sortable: false,
                editable: false,
                /*formatter: 'date',*/
                align: 'center'
            }, {
                label: "金额",
                name: "invAmount",
                index: "offlineCert",
                width: 80,
                sortable: false,
                editable: false,
                formatter: 'amount',
                align: 'center'
            }, {
                label: "税额",
                name: "invTax",
                index: "invTax",
                width: 100,
                sortable: false,
                editable: false,
                formatter: 'amount',
                align: 'center'
            },
            {
                label: "价税合计",
                name: "invTotal",
                index: "invTotal",
                width: 150,
                sortable: false,
                editable: false,
                formatter: 'amount',
                align: 'center',
                formatter: function (cellvalue, options, row) {
                    if (cellvalue==''||cellvalue==undefined) {
                        return '';
                    }else {
                        return cellvalue;
                    }
                }
            },  
            {
                label: "规则校验结果",
                name: "checkStatus",
                index: "checkStatus",
                width: 100,
                sortable: false,
                editable: false,
                align: 'right',
                formatter: function (cellvalue, options, row) {
                    if (checkStatus[cellvalue] == null) {
                        return '';
                    }
                    return checkStatus[cellvalue].text;
                }
            },
            {
                label: "部门",
                name: "dept",
                index: "dept",
                width: 100,
                sortable: false,
                editable: false,
                align: 'center',
                formatter: function (cellvalue, options, row) {
                    if (cellvalue==null||cellvalue==''||cellvalue==undefined) {
                        return "请选择部门";
                    }else {
                        return cellvalue;
                    }

                }
            },
            {
                label: "操作",
                width: 220,
                sortable: false,
                formatter: function (cellvalue, options, row) {
               
                    var op = " "
                     ":job:view">"+op+"";

                    op += "" + " "+
                        "" + " "+
                        "";
                    if (row.extField1 !=null ) {
                        op += "";
                    }
                 
                    return op;
                }
            },
            {name: 'edocCompanyCode', hidden: true}
        ],{
            multiselect: true, shrinkToFit: false, subGrid: true,
            footerConfig: {
                'invDate': '已选中[{R.count}]条,合计:',
                'invAmount': 'sum()',
                'invTax': 'sum()',
                'invTotal': 'sum()',
                'extField3': 'sum()',
                'extField5': 'sum()'
            },
 
            mySubGridModel: [
                {name: 'id', hidden: true},
                {label: "名称", name: "itemName", index: "itemName", width: 100, sortable: false},
                {label: "规格型号", name: "itemSpec", index: "itemSpec", width: 80, sortable: false},
                {label: "单位", name: "unit", index: "unit", width: 80, sortable: false},
                {label: "数量", name: "itemQuantity", index: "itemQuantity", width: 150, sortable: false},
                {label: "单价", name: "itemPrice", index: "itemPrice", width: 100, sortable: false},
                {label: "金额", name: "itemAmount", index: "itemAmount", width: 100, sortable: false},
                {label: "税率", name: "itemTaxRate", index: "itemTaxRate", width: 100, sortable: false},
                {label: "税额", name: "itemTax", index: "itemTax", width: 100, sortable: false},
                {label: "含税金额", name: "itemTotal", index: "itemTotal", width: 100, sortable: false},
                {label: "实际报销含税金额", name: "extField3", index: "extField3", width: 100, sortable: false,editable:true,
                    formatter: function (cellvalue, options, row) {
                        if (cellvalue==undefined||cellvalue==null||cellvalue=='') {
                            return '';
                        }else {
                            return cellvalue;
                        }
                    }
                },
                {label: "实际报销税额", name: "extField5", index: "extField5", width: 100, sortable: false,editable:true,
                    formatter: function (cellvalue, options, row) {
                        if (cellvalue==undefined||cellvalue==null||cellvalue=='') {
                            return '';
                        }else {
                            return cellvalue;
                        }
                    }
                },
                {
                    label: "操作", sortable: false,
                    formatter: function (cellvalue, options, row) {
                        return "" + " "+
                            "" + " "+
                            "";
                         
                    }
                }
        });

你可能感兴趣的:(jsp,datagrid)