Developing Spreadsheets with Handson Table

Asked 5 months ago, Updated 5 months ago, 18 views

We use HandsonTable to develop spreadsheets.
As for the source, the alert part below is for checking, and I'm actually trying to send it to the server by ajax.

<!DOCTYPE html>
<html lang="ja">
  <link rel="stylesheet" href="css/handsontable.full.css">
  <script src="js/handsontable.full.js">/script>
    var logs = $('#logs'),
    gridContainer= document.getElementById('grid'),
    selectedRow = 0,
    selectedCol = 0,
    gridTable = new Handsontable(gridContainer, {
        data —getData(),
        rowHeaders: true,
                for (vari=0; i<changes.length;i++) {
                    var rowChange=changes[i];
    $(document).on('click', '#btn-consoledata', function(e){
        var statdata=gridTable.getData();
    return [
        ['A', 'B', 'C',]
    <div><button id="btn-consoledata">OK</button></div>

Run this source as follows:
①Display Screen
Enter a description of the image here
②Modify Data
Enter a description of the image here
③Press OK to display alerts
Enter a description of the image here

As mentioned above, I have been able to retrieve the change data, but
The data format is csv and the number of columns is unknown.
I would appreciate it if you could tell me how to get the number of columns or how to get the data in an array.
Thank you for your cooperation.

javascript jquery ajax

2022-09-30 11:13

1 Answers

Does getData() return a two-dimensional array?alert(statdata[0]); will only display the first line.
I feel like alert is just displaying a two-dimensional array as CSV.

  • There are methods called countRows() and countCols() to get rows and columns, which are useful.
  • If you want to retrieve data simply, you can retrieve it anywhere by using the above functions and getDataAtCell(row,col).
  • You can also use
  • or getDataAtCol(col) and getDataAtRow(row) to retrieve a row (one line).

2022-09-30 11:13

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.