ce icon indicating copy to clipboard operation
ce copied to clipboard

Add default headers as key in the in getjson method

Open akashkodesia opened this issue 2 years ago • 1 comments

Get key default / modified header as a key in getJson method for for each column, right now we only get index number.

akashkodesia avatar Sep 17 '22 05:09 akashkodesia

Hi,

You can defined name property of column when you change header :

const myTable = jspreadsheet(DOMElement, {
     /* ... your config ... */
     onchangeheader: function(el, column, oldValue, newValue) {
        this.options.columns[column].name = newValue;
    },
});

And after, when you call myTable.getJson(), you have property name instead of index in result

GBonnaire avatar Sep 20 '22 08:09 GBonnaire