Server side processing - not working

Server side processing - not working

sevenkev1sevenkev1 Posts: 1Questions: 0Answers: 0
edited April 2010 in General
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?

Replies

  • bilbodigibilbodigi Posts: 18Questions: 0Answers: 0
    Try to change the table to something like this
    [code]



    col1
    col2




    H
This discussion has been closed.