Changing mergeCells contextMenu names

Tags: #<Tag:0x00007f136023d168> #<Tag:0x00007f136023d028>

Hi there,

I am trying to change the name of the merge and unmerge contextMenu options, but I dont see anyway to do so without having to re-implement them from scratch. I have a contextMenu that looks like this:

items: {
…//other custom or default items here
mergeCells: {}
}

Now I want to change the names for merge and unmerge to, for instance, something like “Merge MY cells”. I can’t find anything in the documentation that specifies how to specifically target the merge and unmerge options in the context menu without having to rewrite their implementations from scratch.

For instance, if I do something like this:

mergeCells: {
name: “Merge MY cells”
}

It renames both the merge and unmerge options to “Merge MY cells”. How can I target each individually without having to rewrite all their logic?

Thanks in advance!

Actually, I figured out my own question. Just leveraged the implementation in the source code and applied my own naming functions.

That said, I’m open to hearing if there are any pitfalls to this approach I should be aware of!

Thanks,

Hi @jared

In general, we don’t recommend modifying the source code and the internal methods, as that might render problems later when we change something internally. We don’t communicate such changes in the release notes, so it might be hard to track.

However, I think it might be worth adding this function by us. If you’d like to see such change, and it’s relatively small, you can create a PR by yourself, and we will review it: https://github.com/handsontable/handsontable/pulls