Using Datatables with MVC4 and WebAPI
Using Datatables with MVC4 and WebAPI
FredFlintstone
Posts: 24Questions: 0Answers: 0
hi - i have been trying for a couple of days (i know!) to wire up a datatable with json returned from an apicontroller without success. was wondering if anyone here has managed to do this. among other things, i have tried the approach suggested here:
http://www.briankeating.net/post/2012/07/08/Using-DataTablesnet-with-Asp-MVC-Web-Api.aspx
EDIT: the approach advocated is:
[code]
$('#example').dataTable({
"bJQueryUI": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/api/myapicontroller/get"
});
[/code]
without success. i can't even make the call hit the controller.
also tried $.getJSON which does call the controller but the datatable resolutely refuses to render out the returned JSON. :(
http://www.briankeating.net/post/2012/07/08/Using-DataTablesnet-with-Asp-MVC-Web-Api.aspx
EDIT: the approach advocated is:
[code]
$('#example').dataTable({
"bJQueryUI": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/api/myapicontroller/get"
});
[/code]
without success. i can't even make the call hit the controller.
also tried $.getJSON which does call the controller but the datatable resolutely refuses to render out the returned JSON. :(
This discussion has been closed.
Replies
2. Please link us to a test page showing the issue.
Allan
public IEnumerable Get(int sEcho,
int iDisplayStart,
int iDisplayLength,
string sSearch,
int iSortCol_0,
string sSortDir_0)
but this simply isn't being hit.
Allan
Allan
DataTables debug bookmarklet
DataTables is not available on this page.
clearly something is badly wrong with my configuration :(
got it! it was the mvc4 way of bundling scripts that was improperly configured. sorry for wasting your time on this...