I want to ask a question about server side processing

I want to ask a question about server side processing

vinsonvinson Posts: 22Questions: 0Answers: 0
edited March 2012 in General
Hi brothers,

I just look a example
http://datatables.net/release-datatables/examples/server_side/jsonp.html
I download it and try to run in localhost, in the sAjaxSource i use below link is work, no problem
"sAjaxSource": 'http://datatables.net/release-datatables/examples/server_side/scripts/jsonp.php'

I copy the 'http://datatables.net/release-datatables/examples/server_side/scripts/jsonp.php' output to my own server, the sAjaxSource is:
"sAjaxSource": 'http://vinsonchan.com/posts1.php'

The output is the same, but it can't be run, i don't know the reason, please help............

Vinson

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Can you run the debugger over your table please: http://debug.datatables.net ?

    Thanks,
    Allan
  • vinsonvinson Posts: 22Questions: 0Answers: 0
    Hi allan,

    Thank u Allan

    I can't call the api which in different server, so i create an php app to call the different server's api, the method is work, but i don't know the reason.

    Vinson
  • vinsonvinson Posts: 22Questions: 0Answers: 0
    Wow........the debugger is amazing, thank u again allan

    I run the debugger yet, which part info can help me to provide for get helping ??
  • vinsonvinson Posts: 22Questions: 0Answers: 0
    debug code: ufepar
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Hi,

    Thanks for that :-). Given that you are trying, got do a JSONP load, I suspect that the problem is this:

    > "dataType": 'json'

    in your fnServerData method. Try changing that to jsonp and hopefully it will spring into life.

    > which part info can help me to provide for get helping ??

    Its not really a transitional debugger in that regard - more of an information gatherer and display system so I can see what state a table is in and has been configured to be. To some degree to need to know the DataTables code to "get" everything it can show you - but really you can just poke around and glean quite a lot of information by looking at the information presented :-)

    Allan
  • vinsonvinson Posts: 22Questions: 0Answers: 0
    I try to change the "dataType", but it can't get anything to the datatable

    Anyway, thank you Allan

    Now, I use the datatable to call a local php app, and use the php app to get JSON data from server, the method is work, but I don't know how to control the data size, when the data over 50000 rows, I don't want get all, can i use the datatable to control the data, for example get 10 pages, and after user click next page, and get more from server...........

    Vinson
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Yes - use server-side processing:
    http://datatables.net/release-datatables/examples/data_sources/server_side.html
    http://datatables.net/usage/server-side

    Allan
  • vinsonvinson Posts: 22Questions: 0Answers: 0
    If i don't get the data direct from database, is get from an api which provide my search result(format is JSON), the method is also like
    http://datatables.net/release-datatables/examples/data_sources/server_side.html

    thank u again, allan
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    That's fine - you can still use server-side processing like that. But you need to server-side script to met the requirements of DataTables - see the 'usage' documentation.

    Allan
  • vinsonvinson Posts: 22Questions: 0Answers: 0
    Good news for me, thank you!
    I correct datatables' some words to met the server requirement, for example aaData-->data, "iTotalRecords"-->total.........
    is good ?
This discussion has been closed.