小编Fra*_*coV的帖子

Handsontable:jquery合并标题,水平滚动的bug

我目前正在使用handsontable和python + django,我把自定义合并标头与Javascript.这看起来应该是这样的.

但是当我加载页面时.

在此输入图像描述

但是,当我向后滚动并向前移动时,错误会神奇地消失.

在此输入图像描述

这是容器div.

<div class="table-container" style="width: auto; height: 200px; overflow: hidden;margin-top: 20px;">
                                <div id="table-index"  data-productoscomerciales='{{productoscomerciales}}'></div>
                          </div>
Run Code Online (Sandbox Code Playgroud)

这是我的javascript代码.

function createTable(data, container) {    

var str = '<tr id="header-grouping">'+'<th colspan="1"></th>'+'<th colspan="1"></th>'+'<th colspan="1"></th>'+'<th colspan="15">Inventario*</th>' + 
          '<th colspan="9">Producción*</th>'+'</tr>';  

return new Handsontable(container, {
  data: data.slice(2,data.length),
  minSpareRows: 1,
  rowHeaders: false,
  manualColumnResize: true,

  colHeaders: data[0],
  columns: data[1],

  colWidths: [150, 100, 130],
  contextMenu: false,
  afterRender  : function () {$('.htCore > thead > tr').before(str);},
  beforeRender: function() {
        while ($('#header-grouping').size() > 0)
                $('#header-grouping').remove();
    },
    afterColumnResize: function () { …
Run Code Online (Sandbox Code Playgroud)

html javascript django jquery handsontable

5
推荐指数
1
解决办法
1813
查看次数

标签 统计

django ×1

handsontable ×1

html ×1

javascript ×1

jquery ×1