Hello.
I use ver 13.0.3 for non-commercial-and-evaluation license.
I’cant’ get any value from getCellMeta(row, col).type property: it returns full property structure not only the ‘type’.
This is my code:
hot.addHook('beforeChange', function (changes, source) { if (source === 'loadData' || source === 'internal' || changes.length > 1) { return; } console.log('beforeChange event raised...'); console.log(hot.getCellMeta(0, 0).editor); console.log(hot.getCellMeta(0, 0).myPK); console.log(hot.getCellMeta(0, 0).type); })
When I ask for ‘editor’ and ‘myPK’ property I getcorrect value but for ‘type’ I get full propery definition.
This from the console:
beforeChange event raised…
false
true
{editor: false, copyable: false, myPK: true, type: ‘numeric’}
copyable: false
editor: false
myPK: true
type: “numeric”
To be complete I write also the code I use for fill CellPrp (in C#) :
// Cycle on Def table in order to build hot cells properties String CellPrp = "["; foreach (DataRow row in dt_TabDef.Rows) { CellPrp = CellPrp + "{"; if (row["Primary Key"].Equals(true)) { CellPrp = CellPrp + " editor: false , copyable: false, myPK: true,"; } switch (row["Data type"]) { case "varchar" or "bit" or "nvarchar" or "char": CellPrp = CellPrp + "type: 'text',"; break; case "datetime" or "date": CellPrp = CellPrp + "type: 'date',"; break; case "decimal" or "int" or "bigint": CellPrp = CellPrp + "type: 'numeric',"; break; case "time": CellPrp = CellPrp + "type: 'time',"; break; default: CellPrp = CellPrp + "type: 'autocomplete',"; break; } CellPrp = CellPrp.Remove(CellPrp.Length - 1); //remove last comma CellPrp = CellPrp + "},"; } CellPrp = CellPrp.Remove(CellPrp.Length - 1); //remove last comma CellPrp = CellPrp + "]";
As you can see I ask type value for cell located in 0,0, where column 0 is my primary key (note myPk = true).
Coud you help me to recover ‘tepr’ property value as other properties?
Thank.