bootstrap table基本语法

bootstrap table基本语法

bootstrap table 中文网 网址 : https://www.bootstrap-table.com.cn/ 点击进入
HTML部分
<table id="puBmxqjh_table" ></table>
JS部分

   var templateTableParams = {
        classes: "table table-bordered table-hover",
        url: "后台访问路经",
        method: 'post',
        contentType: "application/x-www-form-urlencoded",
        dataType: "json",
        cache: false,     //是否使用缓存,默认为true
        striped: true,    //是否显示行间隔色
        singleSelect: true,   //单选
        clickToSelect: true,  //是否启用点击选中行
        height:600,
        queryParams:function () {
            var params = {
                djh: $("#djh").val(),
                jhlb: $("#jhlb").val(),
                lxdh:$("#lxdh").val(),
                orderNo:$("#orderNo").val(),
                itemCode: $("#itemCode").val(),
                itemName: $("#itemName").val(),
                startDate:$('#startDate').val(),
                endDate:$('#endDate').val()
            };
            return params;
        },
        columns: [
            {
                checkbox: true
            },
            {
                title: '序号', halign: "center", align: 'center',
                formatter: function (value, row, index) {
                    return index + 1;
                }
            },

    {
        field: 'djh', title: '单据号',halign:"center"
    },

    {
        field: 'jhlb', title: '计划类别', align:'center',halign:"center"

    },
    {
        field: 'lrrname', title: '采购员',align:'center', halign:"center"
    }
        ],
        cardView:(function(){ return /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent); })(),
        trimOnSearch: true,
        onlyInfoPagination:false,//显示总记录数  必须打开pagination=true
        pagination: false,      //显示分页
        pageNumber: 1,             //初始化加载第一页,默认第一页
        pageSize:10,               //每页记录数
        pageList:[5,10,20],     //可供选择的每页的行数
        idField: 'id',
        uniqueId: 'id',
        smartDisplay:false,
        onPostBody:function (data) {
         //数据加载时执行
        },
        onDblClickRow: function (row) {
        //双击行时执行
        },
        onLoadSuccess: function(data){
        //数据加载完毕后执行
        }
    };
     $('#puBmxqjh_table').bootstrapTable(templateTableParams);                     

页面效果
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

桀骜浮沉

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

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

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

打赏作者

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

抵扣说明:

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

余额充值