EasyUI总结

场景1:导出表单信息;(拼接一个虚拟form表单然后提交

function exportExcel() 
        {
            var rows = $('#invoiceDetail_dg').datagrid('getData').rows;
            
            if(!rows || rows.length == 0)
            {
                msgShow("提示", "无情信息需要导出", "waring");
                return;
            }
            
            $.messager.progress({
                title: '提示',
                msg:'正在导出EXCEL,请稍候......'
            });
            
             var form = $("<form>");   //定义一个form表单
            form.attr('style', 'display:none');   //在form表单中添加查询参数
            form.attr('target', '');
            form.attr('method', 'post');
            form.attr('action', ${pageContext.request.contextPath}/invoicewo/。。。。/。。。");

            $('body').append(form);  //将表单放置在web中 
            
            var input1 = $('<input>');
            input1.attr('type', 'hidden');
            input1.attr('name', 'invoiceid');
            input1.attr('value', JSON.stringify(Exportinvoiceid));
            form.append(input1);   //将查询参数控件提交到表单上
            
            
            form.submit();

            $.messager.progress('close');
        }
        

场景二:动态表格加载获取数据

    function loaddata(invoiceid,dgid){
            $('#'+dgid).datagrid({ //表格id
                width: '99%', 
                height: 'auto', 
                loadMsg:"数据加载中,请稍后...",
                nowrap: true, 
                striped: true, 
                border: true, 
                collapsible:false,//是否可折叠的 
                url:'${pageContext.request.contextPath}/invoicewo/f。。。。/。。。', 
                remoteSort:false,  
                idField:'id', 
                singleSelect:true,//是否单选 
                pagination:true,//分页控件 
                rownumbers:true,//行号 
                queryParams:
                { //请求参数
                  invoiceid : invoiceid,
                },
                columns:[[
                    {field:'serviceName',title:'服务种类',width:'12%',align:'center'},
                    {field:'skuCode',title:'延保SKU',width:'12%',align:'center'},
                    {field:'woNo',title:'工单号',width:'12%',align:'center'},
                    {field:'cost',title:'工单费用',width:'14%',align:'center'},
                    {field:'woType',title:'工单类型',width:'14%',align:'center',
                        formatter:function(value, row, index){return getWoType(value);}},
                    {field:'createUser',title:'费用核算通过人员',width:'15%',align:'center'},
                    {field:'createTime',title:'费用核算通过时间',width:'15%',align:'center',
                        formatter:function(value, row, index){return timeStampToString(value);}},

                ]],
                onLoadSuccess: function (data){
                     

                }
            });
        }

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WannaRunning

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值