JSGrid onItemSelected Handler
HTML
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/redmond/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.4.1/jsgrid.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.4.1/jsgrid.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jsgrid/1.4.1/jsgrid-theme.css">
<div id="jsGrid"></div>
JavaScript
var data = [
{
"Name": "Otto Clay",
"Married": false
},
{
"Name": "Connor Johnston",
"Married": false
},
{
"Name": "Lacey Hess",
"Married": false
},
{
"Name": "Timothy Henson",
"Married": false
}
];
$("#jsGrid").jsGrid({
height: 300,
width: "100%",
paging: true,
autoload: true,
selecting: true,
controller: {
loadData: function() {
return data;
}
},
fields: [
{ name: "Name", type: "textarea", width: 150 },
{ type: "control" }
]
});
$("#jsGrid").on({
mouseenter: function(){
},
mouseleave: function(){
var item = $(this).data("JSGridItem");
console.log("mouseleave", item);
}
}, "tr");