Ajax call won't run
Ajax call won't run
New to databtables, my server-side function never gets called, anyone know why? Thanks. (when I call the now-empty function you see here directly I do get the expected Json results)
[code]
public class PagesController : Controller
{
public ActionResult AjaxMasterCatGrid(jQueryDataTableParamModel param)
{
// blah blah this does not matter it doesn't get hit, why?
}
}
$(document).ready(function () {
$('#tblCats').dataTable({
"bServerSide": true,
"sAjaxSource": "Pages/AjaxMasterCatGrid",
"bProcessing": true,
"aoColumns":
[
{
"sName": "Name",
"bSearchable": false,
"bSortable": true
},
{
"sName": "Code",
"bSearchable": false,
"bSortable": true
},
{
"sName": "IsPrecontract",
"bSearchable": false,
"bSortable": true
},
{
"sName": "IsActive",
"bSearchable": false,
"bSortable": true
}
]
});
});[/code]
(to be clear, it is "datatabling", I see the Search and so on, the js runs, I just get no data in the grid)
[code]
public class PagesController : Controller
{
public ActionResult AjaxMasterCatGrid(jQueryDataTableParamModel param)
{
// blah blah this does not matter it doesn't get hit, why?
}
}
$(document).ready(function () {
$('#tblCats').dataTable({
"bServerSide": true,
"sAjaxSource": "Pages/AjaxMasterCatGrid",
"bProcessing": true,
"aoColumns":
[
{
"sName": "Name",
"bSearchable": false,
"bSortable": true
},
{
"sName": "Code",
"bSearchable": false,
"bSortable": true
},
{
"sName": "IsPrecontract",
"bSearchable": false,
"bSortable": true
},
{
"sName": "IsActive",
"bSearchable": false,
"bSortable": true
}
]
});
});[/code]
(to be clear, it is "datatabling", I see the Search and so on, the js runs, I just get no data in the grid)
This discussion has been closed.
Replies
Steph
Allan
Now the issue is that it won't page properly, it display all records no matter what.
It does show the pager with four pages correctly [sized per the code below], I know this code is not crapping in the middle because I do get the 10, 20 ALL in my dropdown list defaulted to my chosen page size and when I change that list the pager changes to only two pages . . . but the full display of records does not change. Thanks for the help.
$('#tblCats').dataTable({
"iDisplayLength": 10,
"bServerSide": true,
"sAjaxSource": "AjaxMasterCatGrid",
"bProcessing": true,
"bPaginate": true,
"sPaginationType": "full_numbers",
"aLengthMenu": [
[10, 20, -1],
[10, 20, "All"]
]
No - DataTables doesn't care if the path is relative or absolute. It just makes the request form the loaded page and the server will resolve it.
> Now the issue is that it won't page properly, it display all records no matter what.
Please link to a test case so we can debug and help fix it.
Allan
Can you explain what you want when you say "link to a test case" and how this helps? Thanks.
Link to the page that you are working on, or some other page that shows the issue you are seeing, so I can debug the page and figure out what exactly is happening, otherwise I don't know what is going wrong or why, nor do I have enough information to figure out why it is going wrong.
Allan
Allan
Allan