How do you integrate DataTables into a scriptsharp project?

How do you integrate DataTables into a scriptsharp project?

pkeller3pkeller3 Posts: 1Questions: 0Answers: 0
edited July 2013 in DataTables 1.8
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#?

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    make sure to add the jquery.datatables.js file, and make sure it's AFTER including jquery.js

    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.
This discussion has been closed.