Setting data attribute on each row of a jqgrid table

You can use rowattr to assign any additional attribute to <tr> elements (see the answer and this one for code examples). For example you can use

rowattr: function (rd) {
    return {"data-mydata": JSON.stringify(rd)};
}

to save full input row data as data-mydata attribute. I recommend you to use rowattr``in combination withgridview: true` option to have the best performance results ()

The demo uses above rowattr cade and you can see that rows of grid have additional data-mydata attribute:

enter image description here

Leave a Comment