Search code examples
jqgrid

Set rowId in jqGrid to database's record Id


Generally speaking my jqGrid works as I expect. However, I would like the rowId of each row to be the Id of the record from my database. How does one do this?

My database has column "Id", and that appears in my jqGrid model. I have 3 database records with ids: 12, 13, 14. But the jqGrid rowIds for these records are 1, 2, 3.

How does one make the rowIds be the same as the "Id" column defined within the model?


Solution

  • Sorry, found my answer near immediately (I'd search some time before posting). I have to use key:true apparently for the column in the jqGrid model that will be used for the rowId.