Server side processing doesnt work

Server side processing doesnt work

NewinthezoneNewinthezone Posts: 22Questions: 0Answers: 0
edited April 2012 in DataTables 1.9
Hi I have been trying to get server side processing to work for a couple of weeks now but theres no breakthrough yet.
All the rows from the table appear together on the page, no css and borders and no search query works.

>"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error."

I am simply using a SQL data source which is being bound to a gridview.
[code]
$(document).ready(function () {
var oTable = $('#GridView1').GridviewFix({ header: "headerStyle", row: "rowStyle", footer: "footerStyle" }).dataTable({
"bServerSide": true,
"sAjaxSource": "WebForm4.aspx",
"sPaginationType": "full_numbers",
"oLanguage": {
"sSearch": "Search all columns:"
}});
[/code]

I am using firebug to see my JSON Data but there is no JSON data being detected either by firebug or fiddler.

Do I have to convert the sql data to JSON format or something?

This is my debug link for datatables.
http://debug.datatables.net/anaret

If you see under the json , it just returns the HTML and scripts.
Please help .

Replies

  • drchanixdrchanix Posts: 20Questions: 0Answers: 0
    As per Allan's advice, you might want to check this out, http://datatables.net/usage/server-side.
  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    Thanks for the debug trace - as you say, its returning an HTML page - not a JSON stream. Have a look at the link that drchanix suggested to see what DataTables is expecting.

    > Do I have to convert the sql data to JSON format or something?

    Yes - DataTables is expecting a certain format - you need to return your data in that format, otherwise DataTables doesn't have a chance :-)

    Allan
  • NewinthezoneNewinthezone Posts: 22Questions: 0Answers: 0
    I am working on asp.net . It seems that more is required in that case if you need server side processing . It just simply doesnt work for now
  • NewinthezoneNewinthezone Posts: 22Questions: 0Answers: 0
    Where is the place in my code where I need to specify the format you are talking about and what type of format and where does it have to be layed out
  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    Its detailed in the server-side processing documentation: http://datatables.net/usage/server-side .

    Allan
This discussion has been closed.