How do you integrate DataTables into a scriptsharp project?
How do you integrate DataTables into a scriptsharp project?
pkeller3
Posts: 1Questions: 0Answers: 0
I'm trying to integrate the DataTables library into a scriptsharp project I am working on so that our tables will be sortable. I'm getting an error when starting up my page:
Uncaught TypeError: Object [object Object] has no method 'dataTable' idea.html:26
(anonymous function) idea.html:26
jQuery.Callbacks.fire jquery-1.10.1.js:3074
jQuery.Callbacks.self.fireWith jquery-1.10.1.js:3186
jQuery.extend.ready jquery-1.10.1.js:433
completed
I have this script code in the head of idea.html:
[code]
$(document).ready(function () {
$("table").dataTable();
});
[/code]
And I'm not quite sure how to fix this. I want to apply sorting to any table elements. Anyone have experience using DataTables with script#?
Uncaught TypeError: Object [object Object] has no method 'dataTable' idea.html:26
(anonymous function) idea.html:26
jQuery.Callbacks.fire jquery-1.10.1.js:3074
jQuery.Callbacks.self.fireWith jquery-1.10.1.js:3186
jQuery.extend.ready jquery-1.10.1.js:433
completed
I have this script code in the head of idea.html:
[code]
$(document).ready(function () {
$("table").dataTable();
});
[/code]
And I'm not quite sure how to fix this. I want to apply sorting to any table elements. Anyone have experience using DataTables with script#?
This discussion has been closed.
Replies
usually when I see this error, someone has not included the datatables library, OR they included (or re-included) jquery AFTER including jquery.datatables.js
when you include the datatable script, it adds a bunch of methods to the jquery object. if you re-initialize jquery, you lose those methods.