Is there any way to store more than one value in a cell but display only one. The other one should not be displayed. I want to use it like id for each cell.
Here we have an example how to implement key-value data: https://jsfiddle.net/handsoncode/4es5f28c/ In this example it’s assigned to a dropdown, but you can still get the idea about the principles.
Please, keep in mind that it’s a custom implementation so it might not work perfectly with all of the plugins.
The render fucntion gets called when hansontable is intialized. But I am not loading the data in the table during initialization but i am loading it later using loadData. So when renderer gets called the below function can’t find id:
const keyValueListRenderer = function(hot, TD, row, col, prop, value, cellProperties) {
const item = cellProperties.source.find(({
_id
}) => _id === value);
This solution is based on predefined data in the table, and unfortunately we don’t have any example of something that would work without pre-loaded data. You can treat this example as a guide while implementing the solution that suits your requirements.