layui表格初始化的同时如何向后台传参

js写法

able.render({
                elem: '#stuscore',
                url:'${pageContext.request.contextPath }/getStudentScoreAndPeosonInfoAndCourseInfoController/getStudentScoreAndPeosonInfoAndCourseInfo',
                toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                ,
                defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
                    title: '学生成绩信息',
                    layEvent: 'LAYTABLE_TIPS',
                    icon: 'layui-icon-tips'
                }],
                title: '学生成绩信息',
                initSort: {
                    field: 'sid' //排序字段,对应 cols 设定的各字段名
                    ,type: 'desc' //排序方式  asc: 升序、desc: 降序、null: 默认排序
                },
                skin:'row',
                even:true,
                cols: [
                    [{
                        type: 'checkbox',
                        fixed: 'left'
                    }, {
                        field: 'sid',
                        title: '序号',
                        width: 65,
                        fixed: 'left',
                        sort: true,
                        /*unresize: true,*/
                        templet:function(data){return data.student.sid;},
                    }, {
                        field: 'snum',
                        title: '学生学号',
                        width: 100,
                        templet:function(data){return data.student.snum;}
                    }, {
                        field: 'sname',
                        title: '学生姓名',
                        width: 90,
                        edit: 'text',
                        templet:function(data){return data.student.sname;}
                    },{
                        field: 'scollage',
                        title: '所在学院',
                        templet:function(data){return data.student.scollage;}
                    }, {
                        field: 'sdepartment',
                        title: '所在院系',
                        width: 100,
                        templet:function(data){return data.student.sdepartment;}
                    }, {
                        field: 'sclass',
                        title: '所在班级',
                        width: 80,
                        templet:function(data){return data.student.sclass;}
                    },{
                        field: 'cnum',
                        title: '课程编号',
                        width: 86,
                        edit: 'text',
                        templet:function(data){return data.courseInfo.cnum;}
                    }, {
                        field: 'cname',
                        title: '课程名称',
                        width: 86,
                        edit: 'text',
                        templet:function(data){return data.courseInfo.cname;}
                    }, {
                        field: 'ccount',
                        title: '学分',
                        templet:function(data){return data.courseInfo.ccount;}
                    },{
                        field: 'ctotaltime',
                        title: '学时',
                        width: 60,
                        templet:function(data){return data.courseInfo.ctotaltime;}
                    },{
                        field: 'courseStyle',
                        title: '课程属性',
                        width: 86,
                        templet:function(data){return data.courseInfo.courseStyle;}
                    },{
                        field: 'ctime',
                        title: '开课学期',
                        width: 85,
                        templet:function(data){return data.courseInfo.ctime;}
                    },{
                        field: 'sexamscore',
                        title: '成绩',
                        width: 58
                    },{
                        field: 'reexam',
                        title: '补考学期',
                        width: 60
                    }, {
                        field: 'sexamstyle',
                        title: '考核方式',
                        width: 86,

                    },{
                        field: 'steacher',
                        title: '上传成绩教师',
                        width: 90
                    },{
                        filed:'operation',
                        toolbar: '#barDemo',
                        title:'操作',
                        width:95
                    }]

                ],
                page: true,
                limit:8,
                limits:[8,10,15,20,30,50,100],//可选择每页显示的数量
                response: {
                    statusName: 'code' //数据状态的字段名称,默认:code
                    ,statusCode: 0 //成功的状态码,默认:0
                    ,msgName: '' //状态信息的字段名称,默认:msg
                    ,countName: 'count' //数据总数的字段名称,默认:count
                    ,dataName: 'data' //数据列表的字段名称,默认:data
                },

加上语句即可以实现传参到后台:

where:{tname :document.getElementById("tname").value,}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值