How to change the handsontable context menu language

时间:2015-09-29 00:49:25

标签: handsontable

Does anyone know if it is possible to change the HOT default context menu language? Or do I have to create a custom menu that does the exact same thing?

I could not find anything about it over the net.

Thanks, Lucas

1 个答案:

答案 0 :(得分:3)

您已使用updateSettings在初始化后更改上下文菜单配置。

  container = document.getElementById('example3');

  settings = {
    data: getData(),
    rowHeaders: true,
    colHeaders: true
  };
  HT = new Handsontable(container, settings);

  HT.updateSettings({
    contextMenu: {
      items: {
        "row_above": {
          name: 'insérer une ligne au-dessus',
        },
        "row_below": {
          name: 'Insérer une ligne ci-dessous',
        },
        "remove_row": {
          name: 'supprimer une ligne',
        }
      }
    }
  })