[GH #1878] Remove row menu item when using data source and schema

Tags: #<Tag:0x00007efc64e98ad8> #<Tag:0x00007efc64e988f8>

Hi,

I just tried the code example (plain javascript) chapter “binding to data” and “Function data source and schema” (https://handsontable.com/docs/javascript-data-grid/binding-to-data/#:~:text=Address-,Function%20data%20source%20and%20schema,-If%20your%20dataSchema) .

The example works fine, as expected, but if I add a context menu “contextMenu: [‘row_above’,‘row_below’, ‘remove_row’],” I get the following exception:

Uncaught TypeError: t.split is not a function
at t.setProperty (handsontable.full.min.js:954:4116)
at handsontable.full.min.js:933:134188
at t.rangeEach (handsontable.full.min.js:954:1453)
at t.default.getAtRow (handsontable.full.min.js:933:134038)
at handsontable.full.min.js:933:135458
at t.rangeEach (handsontable.full.min.js:954:1453)
at t.default.getByRange (handsontable.full.min.js:933:135401)
at t.default.getSourceData (handsontable.full.min.js:933:102449)
at handsontable.full.min.js:985:15711
at d.done (handsontable.full.min.js:985:17502)

Is there a workaround to get this to work with data source and schema?

Hi @peter.jeansson

Thank you for contacting us. I checked an example with custom data schema and custom context menu, and it works fine: https://jsfiddle.net/handsoncode/294ow5e3/ Please, modify this example so your issue can be replicated.

Hi Adrian,

Thanks for the reply. I tried the example that you provided and it works :-). The example I tried is #7 (the one after yours) and here is a fiddle of it https://jsfiddle.net/Lmy9zo2j/1/ with the context menu added. This example gives a script error with the context menu enabled.

@peter.jeansson

Thank you for the clarification. In this example I can see the error. It seems to be a bug, but we need to investigate it further. I reported it internally, and I will update you on this once I have more information.