Posted 5 April 2019, 5:21 pm EST
Hi,
I need to find the object type whether it is Row or Column. Here is my sample code (in TypeScript).
public myMethod(panel: wijmo.grid.GridPanel, r: number, c: number, cell: HTMLElement): void {
let className: any;
if (panel.columns[c].binding === “Value”) {
className = this.getClassName(panel.rows[r]);
} else {
className = this.getClassName(panel.columns[c]);
}
// code continues here
…
}
Here is the code in getClassName function:
private getClassName(value: any): boolean { let columnName: any; let fieldDetails: FieldDetails; [b]if (value.GetType() === wijmo.grid.Row) {[/b] columnName = this.flexGrid.columns[1].header; fieldDetails = value._data.row.FieldDetails; [b]}else if (value.GetType() === wijmo.grid.Column) {[/b] columnName = value._hdr; fieldDetails = this.fields.find(field => field._aliasName === columnName); } // code continues here ...............
}
In my above getClassName, the value.GetType() in if and else if throws error as undefined.
How to find the value type whether the passed object is Row / Column type ?
Appreciate your ideas/suggestions.
Thank you.