This is probably a javascript knowledge issue, but I"m trying to set the background colour of a cell from a submenu. But I keep getting “Cannot read properties of undefined” errors from my callback. How do I access the cell metadata from within a submenu callback?
Here is my contextmenu setup…
build_category: { // Own custom option
name: 'Build Category...',
submenu: {
// Custom option with submenu of items
items: [
{
// Key must be in the form 'parent_key:child_key'
key: 'build_category:ootb',
name: 'ootb',
callback(key, selection, clickEvent) {
console.log(JSON.stringify(selection));
this.hot.setCellMeta(2, 2, 'className', 'isConfig');
},
},