Hello.
I've a grid that has 3 columns as key. When I execute the method getCellValue, an error is thrown saying that can't get 'dataType' from null or undefined. The error is produced in this line:
if(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric")
The previous line is this one:
primaryKeyCol=this.columnByKey(this.options.primaryKey);
As this.options.primaryKey has multiple columns, this.columnByKey return null.
How can I do to execute this method?
Hello, you could find a short description how to use the getCellValue method in the API documentation.
For example:var date = $(".selector").igGrid("getCellValue", 3, "ShipDate");Please notice, the columnKey is used ("ShipDate") as well as rowId, in order to specify the exact cell to get the value of.
columnByKey method as well works with the columnKey and returns a column object by the specified column key.
It is worth mentioning, the column key and the primary key have different functions.column key- Column key (property in the data source to which the column is bound).primaryKey - Primary key name of the column containing unique identifiers. It is for example required for functionalities like RowAdding and RowUpdating, so each row could be safely identified as unique.
Please let me know if you require further assistance.
Thanks for your reply. I wasn't mixing columnKey and primaryKey, and I was calling the getCellValue method correctly. Maybe my question wasn't clear enough.
My problem was that I was using multiple columns as a primary keys. I was told in an support case that this is not supported.
Thanks anyway.