Server side processing - not working
Server side processing - not working
I am trying to get a simple server-side implementation to work. Each time the message "Processing..." will appear but nothing else. I've verified that the number of columns match the returned data. Also the returned json is valid as per http://www.jsonlint.com/. What am I doing wrong?
[code]
$(document).ready(function() {
$('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "AjaxTest.aspx/setNames",
"aoColumns": [
{ "sTitle": "Engine" }
]
});
});
[/code]
When I call the below code for testing I get this json returned:
{"sEcho": 2,"iTotalRecords": 2,"iTotalDisplayRecords": 2,"aaData":[ ["Trident"], ["Trident"] ]}
[code]
$.ajax({
type: "POST",
url: "AjaxTest.aspx/setNames",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
alert(msg);
}
});
[/code]
The function that returns the json is simply:
[code]
_
Public Shared Function setNames() As String
Return "{" & """sEcho""" & ": 2," & """iTotalRecords""" & ": 2," & """iTotalDisplayRecords""" & ": 2," & """aaData""" & ":[ [" & """Trident""" & "], [" & """Trident""" & "] ]}"
End Function
[/code]
When I look at the result in firebug I see empty .
What am I doing wrong?
[code]
$(document).ready(function() {
$('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "AjaxTest.aspx/setNames",
"aoColumns": [
{ "sTitle": "Engine" }
]
});
});
[/code]
When I call the below code for testing I get this json returned:
{"sEcho": 2,"iTotalRecords": 2,"iTotalDisplayRecords": 2,"aaData":[ ["Trident"], ["Trident"] ]}
[code]
$.ajax({
type: "POST",
url: "AjaxTest.aspx/setNames",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
alert(msg);
}
});
[/code]
The function that returns the json is simply:
[code]
_
Public Shared Function setNames() As String
Return "{" & """sEcho""" & ": 2," & """iTotalRecords""" & ": 2," & """iTotalDisplayRecords""" & ": 2," & """aaData""" & ":[ [" & """Trident""" & "], [" & """Trident""" & "] ]}"
End Function
[/code]
When I look at the result in firebug I see empty .
What am I doing wrong?
This discussion has been closed.
Replies
[code]
col1
col2
H