使用Handsontable时出现重复的标题 [英] duplicate headers when using Handsontable

查看:318
本文介绍了使用Handsontable时出现重复的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Handsontable,并且标题显示了两次. 是什么导致这种情况发生?

I am working with Handsontable, and the headers are shown twice. What is causing this to happen?

这是我的代码:

<script type="text/javascript">
        $(document).ready(function () {

          var data = [
              ['2009', 0, 2941, 4303, 354],
              ['2010', 3, 2905, 2867, 412],
              ['2011', 4, 2517, 4822, 552],
              ['2012', 2, 2422, 5399, 776]
            ],
            container = document.getElementById('example'), hot;

          hot = new Handsontable(container, {
            data: data,
            minSpareRows: 1,
            colHeaders: true,
            contextMenu: true,
            colHeaders: ['Cuenta Única', 'Número Comercio', 'Número PDV', 'Máximo Cuotas', 'Grupo Afinidad'],
            manualColumnResize: true,
            colWidths: [120, 120, 120, 120, 120, 120],
          });
        });
</script>

<div id="example"></div>

推荐答案

这是交易.如您所知,Handsontable允许您冻结列.为此,始终提供两组表.通过注意第二个表称为ht_clone_top,可以正确地找到它.此克隆使您可以冻结表,因此即使删除它,即使您要修复错误,也将无法冻结行.

Here's the deal. As you may be aware, Handsontable allows you to freeze columns. To do this, there are ALWAYS two sets of tables rendered. You correctly found it by noting that the second table is called ht_clone_top. This clone is what allows you to freeze tables, so if you remove it, even though you will fix your bug, you will not be able to freeze rows.

我可以告诉您我认为可能是您的问题,因为这是一个常见问题.您可能拥有修改表元素的CSS.不幸的是,您必须确保还修改了克隆表.考虑到CSS的本质,要解决这个问题确实很棘手,但是经过足够的努力,您可以解决此问题!

I can tell you what I think might be your problem as this is a common issue. You probably have CSS which modifies your table element. Unfortunately, you have to ensure that you also modify the clone tables. It's a really tough problem to solve given the nature of CSS but with enough effort, you can fix this issue!

这篇关于使用Handsontable时出现重复的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆