This topic contains 2 replies, has 2 voices, and was last updated by pdr 7 years, 10 months ago.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
jQuery UI Widgets › Forums › Grid › Trying to get the cellclick event triggered.
Tagged: #jquerygrid, grid, javascript grid, jquery grid, jqwidgets grid
This topic contains 2 replies, has 2 voices, and was last updated by pdr 7 years, 10 months ago.
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
Hey Patrick,
The event binding should be before the }); which closes the document.ready block.
Best Regards,
Peter Stoev
jQWidgets Team
http://www.jqwidgets.com/
Ahhhhhh!
Thank you Peter. I knew it was stupid… 🙁
You must be logged in to reply to this topic.