Try the following:
var ids = jQuery("#list").jqGrid('getDataIDs'); for (var i = 0; i < ids.length; i++) { var rowId = ids[i]; var rowData = jQuery('#list').jqGrid ('getRowData', rowId); console.log(rowData.Phrase); console.log(rowId); }
Please note: if your goal is to add a link to a cell that calls the javascript method, you can achieve this using formatter as follows, formatter should be added to colModel, as you add other column properties such as name, index, width, align, etc., so you can avoid iterating over the string data
formatter: function(cellvalue, options, rowObject) { return "<a href='#' onclick='openForm(" + rowObject.ID + ", " + rowObject.Phrase + ")'>View</a>"; }
source share