I have been at this for over an hour and I am getting nowhere. I need to use a variable containing a string literal to replace a key in an Object for a DHX method, but it does not work.
When I place the 'actual' string into the method, it works perfectly. Here is what works ('col5' is the key in the object):
grid.data.update(2, {col5: 1} );
But ... if I now introduce a variable containing the same string literal, it fails (does not update the grid). This does not work:
let x = "col5"
grid.data.update(2, {x: 1} );
When I view this variable in console.log, it shows up perfectly. I even tried JSON.stringify to see if it needed to be converted, but that did not work either.
I'm looking for a way to use a variable in place of a key in this object.