Korr Iamnot Korr Iamnot - 1 year ago 102
Javascript Question

jqGrid get rowid on the first column

I'd like to have my jqGrid first column to be the rowid

number | name | class
1 | A | acceptable
2 | B | good
3 | C | bad

or add first column like this (picture)


how to get the rowID in jqGrid on the first column by setting the option?

Answer Source

I suppose that you mean row number instead of rowID. To add column with row number you can add rownumbers: true option to jqGrid. If you really need to display rowid, then you have to extend colModel with the corresponding column and fill the values for the column exactly like you fill the data of all other columns.

Additionally I would recommend you to use height: "auto" option to improve visibility of the grid or to use alternatively scrollOffset: 0 option which will remove unneeded place on the side of the grid reserved for the vertical scroll bar.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download