Fragsworth
Fragsworth

Reputation: 35607

How to access the fields of a jqGrid row?

Suppose I have the following (shortened for simplicity):

jQuery("#grid").jqGrid({
    ...
    ondblClickRow: function(rowid) {
        // I want to access the fields of the double-clicked row in here
    }
    ...
});

Inside the ondblClickRow event, I want to access the fields of the row.

How is this done?

Upvotes: 2

Views: 4112

Answers (2)

Aaron
Aaron

Reputation: 11

If you call the getRowData method with the rowid parameter, it will return all the data in all the cells of the row. It will return the cell contents with the colModel name of the cell containing the data in an array made of name:value pairs. I think that's more like what you're asking to see, isn't it?

Upvotes: 1

SLaks
SLaks

Reputation: 888205

Call the getCell method with the rowid parameter and a column index.
See the documentation.

Upvotes: 4

Related Questions