Good Day,
I want to figure out a way to get the selected column name and the first value of the row of which the cell is selected, right now the celldoubleclick event is working okay, but it only brings me the columnIndex and rowIndex.
I would like to have for example (please see the attached image), when I double click the cell [3, 4] to get the values "COLOR" and "Canada".
Is there any way to do this easily?
Thanks!
PivotSummary.on('celldoubleclick', function (cell) {
var obj = {
column: cell.columnIndex,
row: cell.rowIndex - 1
};
alert(obj.column + " " + obj.row);
}
Hello,
Thank you for reaching out to us.
To retrieve the column's name, use the hierarchy
property of the Cell Data Object.
The first value of the column can be obtained using the getCell API call with the corresponding arguments.
You are welcome to see the JSFiddle we have prepared for the demonstration: https://jsfiddle.net/flexmonster/mfepzjv3/.
Please let us know if it works for you.
Our team is looking forward to hearing your feedback.
Regards,
Illia
Hello,
I made it work with your example, I just made a little change to get the first value of the row:
flexmonster.on("celldoubleclick", data => {
let columnName = data.hierarchy ? data.hierarchy.caption : "Unknown";
let firstValue = flexmonster.getCell(data.rowIndex, 0).label;
alert(columnName + " - " + firstValue);
})
Other than that it works great, Thanks!
Hello,
Thank you for your feedback.
Our team is happy to hear the solution works well for you.
Feel free to contact us in case any other questions arise.
Kind regards,
Illia