datatable killing function
datatable killing function
Whenever I use datatable all my td onclick functions quit working.
For example this works:
[code]
$(document).ready(function() {
$("#example td").click(function(e) {
var currentCellText = $(this).text();
alert (currentCellText);
});
} );
[/code]
But when I do this it quits working:
[code]
$(document).ready(function() {
$("#example td").click(function(e) {
var currentCellText = $(this).text();
alert (currentCellText);
});
var oTable = $('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"bSortClasses": false,
"sAjaxSource": "get_the_data.php"
} );
} );
[/code]
I know it's probably something simple but I can't figure it out. I'd pull my hair out if I wasn't already bald.
For example this works:
[code]
$(document).ready(function() {
$("#example td").click(function(e) {
var currentCellText = $(this).text();
alert (currentCellText);
});
} );
[/code]
But when I do this it quits working:
[code]
$(document).ready(function() {
$("#example td").click(function(e) {
var currentCellText = $(this).text();
alert (currentCellText);
});
var oTable = $('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"bSortClasses": false,
"sAjaxSource": "get_the_data.php"
} );
} );
[/code]
I know it's probably something simple but I can't figure it out. I'd pull my hair out if I wasn't already bald.
This discussion has been closed.
Replies
You can also use Visual Event to see what elements have event handlers attached to them: http://www.sprymedia.co.uk/article/Visual+Event
Allan
Not checking jQuery version on a new website ... Idiotic! All my problems are solved now that I checked the basics ... ARG!
BTW, I had read those pages. But nothing I did worked. And now we know why.
Thanks Allan!