jqGrid: Making a row a link
Had a situation where I wanted the user to double click on a row to view details of the item. This makes the row appear as a 'link' by setting the cursor to pointer and disables all selection so even if they click and drag they don't see the annoying blue highlight.
.pointer {
cursor: pointer;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
$('#grid').jqGrid({
rowattr: function (rd) { return { 'class': 'pointer' }; },
beforeSelectRow: function(){ return false; },
ondblClickRow: function (rowid) {
var rowData = $(this).getRowData(rowid);
document.location.href = "controller/action/" + rowData['Id'];
}
});
Written by Charles Solar
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#