I have a handsontable like this on click issue i need to open a modal how to achieve this ??
Hey @chethanbv.10
here’s an example with a modal window https://codepen.io/anon/pen/rJMaNJ?editors=1010
I have used a button. To use a link you can attach the window logic to a afterOnCellMouseDown hook.
What you had sent is applying only for first row
Yes, as there is only one button in the table - in the first cell of the first row.
You can use the afterOnCellMouseDown hook combined with afterSelectionEnd method. The method returns coordinates (row and column) so when column === hot.countCols()-1 (last column) you can open the window.
Sorry i didn’t get that can u explain it briefly ??
I’ve made it even simpler for the sake of the demo https://codepen.io/anon/pen/bOYaQo?editors=0010
I need one more help on each selected modal i need to get the data of selected row inside handsontable
Here’s a demo you can use https://jsfiddle.net/y4mw8hnd/ @chethanbv.10
It logs data from a selected row in a console
thank you @aleksandra_budnik i have a selected row data in Array format how to get that particular data
["A2" , "B2" , "C2" , "D2" , "E2" , "F2" , "G2" , "H2" , "I2" , Array[1] ]
0: “A2”
1: “B2”
2: “C2”
3: “D2”
4: “E2”
5: “F2”
6: “G2”
7: “H2”
8: “I2”
9: “Array(1)[‘something’]”
now i need last row data that is 9th row which have some Array value in it when i clicked on that column i need that specific column data
Hi @aleksandra_budnik i have array like shown in this image
and my code looks like this
afterSelection: function (r, c) {
var rowData = this.getDataAtRow(r)
console.log(rowData);
console.log(rowData[11])
var rowD = rowData[11][0]
console.log(rowD)
$("#issueModal").modal({
closable: false,
onShow: function () {
_this.issueTab.handsontable({
data: rowData[11],
manualColumnResize: true,
rowHeaders: true,
colHeaders: true,
colHeaders: ["", "Issue","data"],
columns: [
{ data: "", readOnly: true },
{ data: "[0]", readOnly: false },
],
});
}
}).modal('show');
},
now what i stored that array which has shown in image is stored in variable console.log(rowData[11])
now in thst array i need to print value at 0 position inside another handsontable as shown in below image how to put that value inside that handsontable
i want to update that value inside this issue column how to do that please help me
Hey @chethanbv.10
Handsontable supports an array of arrays or arrays of objects. Next levels of nesting data aren’t supported.