getCellMeta() method returns ColumnSettings object

Tags: #<Tag:0x00007f8b1d44b038>

Hi all,

I’ve having a little bit of trouble understanding the getCellMeta() method and its return value. According to the Handsontable docs, the cellProperties object should be returned for the given cell. However, the value that I’m seeing returned is a ColumnSettings object. I can’t find much info about this object, other than it doesn’t seem to be the same as cellProperties. Can anyone tell me if this is the expected behaviour?

Here’s an example of the code:

afterValidate (isValid, value, row, prop, source) {
      const cellProperties = this.$refs.spreadsheet.table.getCellMeta(row, prop)
      console.log(cellProperties) // ColumnSettings, not cellProperties object...
}

I’m using the vue-handsontable wrapper, if that changes anything.

Thanks!

Hi @carl.masri

Please take a look at this demo https://jsfiddle.net/handsoncode/dfv0xray/

You get an object that holds the meta data.

In the demo I log a cell type, class name and check if it is readonly.

What exactly you would like to achieve?

Ah, okay. So it looks like the ColumnSettings object I was referring to is the same as cellProperties. I didn’t realize that the commonly-referenced properties (className, readOnly, type, etc) are not directly on the object returned from getCellMeta(), but rather up its object prototype chain.

My goal was to add some additional (non-standard) metadata to the cellProperties object which could then be used in a custom renderer function, which I’ve got working via the setCellMeta() method.

Thanks!

1 Like

You’re welcome.

As now everything is clear we can close the topic.