Hello everyone,
I’m new to jqxgrid and Javascript… So please be patient. I’m simply trying to the the content of the selected row whenever a row is selected. In order to get there, I was just trying to trigger the event when a row/cell is clicked on. I’ve browse the forum and all answers found do not seem to work. I guess the problem is fairly simple but I can’t figure it out. Here’s the code.
<!DOCTYPE html>
<head>
…
<script type=”text/javascript”>
$(document).ready(function () {
var url = ‘lst.txt’;
var source =
{
datatype: “csv”,
datafields: [
{ name: ‘Forme’, type: ‘date’ }
],
url: url
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#jqxgrid”).jqxGrid(
{
width: 100,
source: dataAdapter,
columnsresize: true,
columns: [
{ text: ‘Forme’, datafield: ‘Forme’, width: 100 } ]
});
});
$(‘#jqxgrid’).on(‘cellclick’, function (event) {
alert(‘test’);
});
</script>
</head>
<body>
<div id=”header”>Header</div>
<div id=”main-wrap”>
<div id=”jqxgrid”>
</div>
<div id=”content-wrap”>
</div>
<div id=”footer”>Footer</div>
</body>
</html>
The file gets loaded in the widget without a problem but the event does not get triggered. Any help will be appreciated.
Thanks,
Patrick