如题,具体表现为固定的几列Z轴方向处于原表的前面,把checkbox框给覆盖了。。
js
$("#taskwaybill_bootstrap-data-table").bootstrapTable({
url : option.url,
method : option.method ? option.method : "GET",
queryParams : option.param,
height : 300,
pageSize : option.pagesize, // 每页显示的记录数
pageNumber : option.pagenumber, // 当前第几页
columns : option.columns,
cache : false,
showRefresh: true,
search: true,  // 是否启用搜索
sortable : true, // 是否启用排序
sortOrder : "asc", // 排序方式
pagination : false,

 leftFixedColumns: true,
 leftFixedNumber: 2,
 rightFixedColumns: true,
 rightFixedNumber: 1,

pageSize : 100,
clickToSelect : false,
singleSelect : false,
// paginationRefreshText : "<img src='images/page-refresh.png'>刷新",// 刷新
rowStyle : function(row, index) {
var style = {};
style = {
css : {
'color' : '#000000'
}
};
return style;
},
formatLoadingMessage : function() {
return "请稍等,正在加载中...";
},
formatNoMatches : function() { // 没有匹配的结果
return '无符合条件的记录';
},
formatRecordsPerPage : function(pageNumber) {
return pageNumber;
},
// onClickCell : function(field, value, row, $element) {
//
// },
onClickRow : function(row, $element, field) {// 行点击方法
getWaybillTasks(row.waybillId);
checkedwaybillid = row.waybillId;
checkedwaybillvolume = row.volume;
checkedwaybillweight = row.weight;
checkedwaybillquantity = row.quantity;
checkedsponsor = row.sponsor;
checkedxAxis = row.xAxis;
checkedyAxis = row.yAxis;
checkedzAxis = row.zAxis;
checkedsponsor = row.sponsor;
checkedtaskid = row.id;
checkedgoodsnum = row.quantity;
checkedtruckId = row.truckId;

/*$('td').css("background","white");
$element.find('td').css("background","#EDEDED");*/
},
 onLoadSuccess : function() {// 加载成功时执行
 $('#taskwaybilllist').find("button[name='refresh']").html('刷新列表').css('margin-top','12px').removeClass('btn-default').addClass('btn-prime');
 }
});
如果有大神需要其他代码的,请联系我,第一次发帖提问,多多海涵

解决方案 »

  1.   

    您好,大神,我需要冻结列的代码,我是使用bootstraptable绑定的数据,第一列是一个复选框,可以选中进行删除
      

  2.   

    你好,你的复选框失效是因为开启了冻结列后。把冻结的那几列给复制出来成了一个独立的表格,所以你之前的事件已经没用。你需要在重新绑定下,你可以通过F12调试看下节点名称。可以参考下我这个://全选
         $('.fixed-table-container').on('click','input[name="btSelectAll"]',function(){
                if($(this).is(':checked')){
                    $('input[name="btSelectItem"]').prop('checked',true);
                }else{
                    $('input[name="btSelectItem"]').prop('checked',false);
                }
            })
            //逐个选择
            $('.fixed-table-container').on('click','input[name="btSelectItem"]',function(){
                var inputs = $(this).parents('.fixed-table-body-columns').find('input[name="btSelectItem"]')
                var num = 0;
                inputs.each(function(){
                    if($(this).is(':checked')){
                        num++;
                    }
                });
                if(num==inputs.length){
                    $('input[name="btSelectAll"]').prop('checked',true);
                }else{
                    $('input[name="btSelectAll"]').prop('checked',false);
                }
                var index = $(this).parents('tr').index();
                $('#Table1').find('input[name="btSelectItem"]').eq(index).click();
            });