<CSS>
<style>
.cursor {
cursor:pointer;
}
</style>
<script type="text/javascript">
<GRID>
$(function () {
$("#Grid").ejGrid({
. . .
recordClick:"recordClick",
columns: [
{ field: "OrderID", isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, validationRules: { required: true, number: true }, width: 90 },
{ field: "CustomerID", headerText: 'Customer ID', validationRules: { required: true, minlength: 3 }, width: 90 },
{ field: "EmployeeID", headerText: 'Employee ID', editType: ej.Grid.EditingType.Dropdown, textAlign: ej.TextAlign.Right, width: 80 },
. . .
]
});
});
<Record Click Event>
function recordClick(e) {
var previousCursor = this.element.find(".e-gridcontent").find("tr.cursor"); // find the row which has cursor class
if ($(previousCursor).hasClass("cursor"))
$(previousCursor).removeClass("cursor"); //Remove the cursor class
$(e.row).addClass("cursor"); // Add the cursor class for selected row
} </script> |