代码之家  ›  专栏  ›  技术社区  ›  Cornwell

新HandsOnTable版本中不显示滚动条

  •  3
  • Cornwell  · 技术社区  · 11 年前

    我最近从0.8.23升级到0.10.3,我面临一个奇怪的问题——垂直滚动条没有显示。

    我附上了同一页的两张截图(一张运行0.8.23,另一张运行0.10.3)

    0.8.23 0.8.23

    0.10.3 0.10.3

    代码相同。

    2 回复  |  直到 11 年前
        1
  •  1
  •   RossG    11 年前

    下面是该版本滚动条工作的示例 on jsfiddle 。如果你发布你的代码,如果你不能发现差异,这也会有帮助。

    下面是jQuery:

    $(document).ready(function () {
    
      var data = [
        ["", "Maserati", "Mazda", "Mercedes", "Mini", "Mitsubishi"],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2010", 5, 2905, 2867, 412, 5284],
        ["2011", 4, 2517, 4822, 552, 6127],
        ["2012", 2, 2422, 5399, 776, 4151],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2010", 5, 2905, 2867, 412, 5284],
        ["2011", 4, 2517, 4822, 552, 6127],
        ["2012", 2, 2422, 5399, 776, 4151],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2010", 5, 2905, 2867, 412, 5284],
        ["2011", 4, 2517, 4822, 552, 6127],
        ["2012", 2, 2422, 5399, 776, 4151],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2010", 5, 2905, 2867, 412, 5284],
        ["2011", 4, 2517, 4822, 552, 6127],
        ["2012", 2, 2422, 5399, 776, 4151],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2010", 5, 2905, 2867, 412, 5284],
        ["2011", 4, 2517, 4822, 552, 6127],
        ["2012", 2, 2422, 5399, 776, 4151],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2010", 5, 2905, 2867, 412, 5284],
        ["2011", 4, 2517, 4822, 552, 6127],
        ["2012", 2, 2422, 5399, 776, 4151],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2010", 5, 2905, 2867, 412, 5284],
        ["2011", 4, 2517, 4822, 552, 6127],
        ["2012", 2, 2422, 5399, 776, 4151],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2010", 5, 2905, 2867, 412, 5284],
        ["2011", 4, 2517, 4822, 552, 6127],
        ["2012", 2, 2422, 5399, 776, 4151],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2010", 5, 2905, 2867, 412, 5284],
        ["2011", 4, 2517, 4822, 552, 6127],
        ["2012", 2, 2422, 5399, 776, 4151],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2009", 0, 2941, 4303, 354, 5814],
        ["2010", 5, 2905, 2867, 412, 5284],
        ["2011", 4, 2517, 4822, 552, 6127],
        ["2012", 2, 2422, 5399, 776, 4151],
        ["2009", 0, 2941, 4303, 354, 5814]
      ];
    
      $('#example').handsontable({
        data: data,
        minSpareRows: 1,
          scrollV: 'auto',
        colHeaders: true,
        contextMenu: true
      });
    
    
      function bindDumpButton() {
          $('body').on('click', 'button[name=dump]', function () {
            var dump = $(this).data('dump');
            var $container = $(dump);
            console.log('data of ' + dump, $container.handsontable('getData'));
          });
        }
      bindDumpButton();
    
    });
    
        2
  •  0
  •   Salman Kaludi    10 年前

    只是您在“jquery.handcontainable.full.js”函数中更改了WalkontableSettings(例如,设置),将“renderAllRows”属性更改为true。