Hi @aleksandra_budnik ,
I need to get handson table data as key value pairs as json data on click of a button.
Hi @aleksandra_budnik ,
I need to get handson table data as key value pairs as json data on click of a button.
Hi @sumanthhs48
Maybe this demo will help https://jsfiddle.net/handsoncode/f0b41jug/. It uses custom cell validator, editor and renderer for the key-value dropdown.
So you keep the table data as an array of objects and then you want to retrieve the table data (as I understand the altered data). I am right?
If so here are related topics
https://handsontable.com/docs/api/core/#getdata
https://handsontable.com/docs/api/core/#getsourcedata
Actually getSourceData() function shows undefined
Does my demo return undefined
for you?
It returns data for me (on Chrome 99)
Handson table version 0.16.0 it happens here when data is added in this format
const data = [
['', 'Tesla', 'Nissan', 'Toyota', 'Honda', 'Mazda', 'Ford'],
['2017', 10, 11, 12, 13, 15, 16],
['2018', 10, 11, 12, 13, 15, 16],
['2019', 10, 11, 12, 13, 15, 16],
['2020', 10, 11, 12, 13, 15, 16],
['2021', 10, 11, 12, 13, 15, 16]
];
The getSourceData
was not available in version 0.16. If you update to a newer version the issue is gone.
Actually newer version does not support select 2 renderer
Select 2 is not an official Handsontable project and we do not support it.
Handsontable does not support this functionality yet. If there is an alternative, it is also a 3rd party project.
Can we get value with handsontable dropdown.
Do you mean how to get the value that was chosen by the user upon change?
Sorry, we do not have any demos other than https://jsfiddle.net/handsoncode/f0b41jug/ for the dropdown key-value subject.