jqgrid表格控件

  1. 需引入
    <link rel="stylesheet" href="${path}/style/bootstrap/jqgrid/css/css/hot-sneaks/jquery-ui-1.8.16.custom.css">
    <link rel="stylesheet" href="${path}/style/bootstrap/jqgrid/boot/css/trirand/ui.jqgrid-bootstrap.css">
    <script src="${path}/style/bootstrap/jqgrid/js/i18n/grid.locale-cn.js"></script>
    <script src="${path}/style/bootstrap/jqgrid/boot/js/trirand/jquery.jqGrid.min.js"></script>
    <script src="${path}/style/bootstrap/js/ajaxfileupload.js"></script>
  1. 一个例子
<script>
    $(function (){
   
        pageInit();
    })

    function pageInit() {
   
        $("#videoTable").jqGrid({
   
            url: "${path}/emp/fenye",   //page,rows   //返回数据:total总页数 records总条数  page当前页  row数据
            editurl: "${path}/emp/edit",
            datatype: "json",
            cellEdit:true,
            rowNum: 2,
            rowList: [2, 10, 20, 30],
            pager: '#videoPage',
            styleUI: "Bootstrap",
            autowidth: true,
            reloadAfterSubmit: true,
            height: "auto",
            viewrecords: true,  //是否显示总条数
            colNames: ['ID', '员工名', '工资', '年龄', '部门'],
            colModel: [
                {
   name: 'id', index: 'id', width: 55},
                {
   name: 'empname', editable: true, index: 'invdate', width: 90},
                {
   name: 'salary', editable: true, index: 'invdate', width: 90},
                {
   
                    name: 'age', editable: false, index: 'name asc, invdate', width: 100, align: "center"
                },
                {
   
                    name: 'deptname',editable: true, index: 'amount', width: 80, align: "right"
                }
            ]
        });
        //编辑工具栏
        //编辑工具栏
        $("#videoTable").jqGrid('navGrid', '#videoPage',
            {
   edit: true, add: true, del: true, addtext: "添加"},
            {
   
                closeAfterEdit: true,
                reloadAfterSubmit: false,
                afterSubmit: function (data
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值