$.extend($.fn.bootstrapTable.defaults, {

stickyHeader: false,

stickyHeaderOffsetY: 0,

fixedColumns: true, //固定列

fixedNumber: 4 //固定第3列

});

{ key: 'matchPositionX', value: function matchPositionX() {

var left = this.$tableBody.scrollLeft(); this.$stickyContainer.scrollLeft(left);

//是否有固定表列 if (this.options.fixedColumns === true) {

var fixedNumber = this.options.fixedNumber;

this.$stickyHeader.find('tr:eq(0)').find('th').each(function (index, el) {

$(el).css("background-color", "white");

$(el).css("position", "relative");

$(el).css("z-index", "100");

//大于设置的固定表列,设置滚动

if (index >= fixedNumber) {

$(el).css('transform', 'translateX(-' + left + 'px)');

$(el).css("z-index", "99"); } }); } } }

 
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-12-23
  • 2021-08-07
  • 2022-12-23
  • 2021-08-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案