fnServerData - Delphi App Server

fnServerData - Delphi App Server

AlekXLAlekXL Posts: 9Questions: 0Answers: 0
edited July 2012 in General
fnServerData is badly documented. To what variable should I return JSON Object??
[code]
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bPaginate": true,
"bFilter": true,
"bSort": true,
"aoColumnDefs":[
{"bSortable":false, "aTargets":[0,11]},
{"bSearchable":true,"aTargets":[1,2,3]},
{"bSearchable":false,"aTargets":[0,4,5,6,7,8,9,10,11]},
],
"fnServerData": function ( sSource, aoData, fnCallback ) {
var returnObj;//like { "sEcho": 3, "iTotalRecords": 57, ... TO WHERE????
aoData=serverMethods().getProds(sSource, aoData);
}


});
[/code]
I am able to get aoData on Delphi app server, but to where shoud I save returned object?

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Pass the JSON object into fnCallback : http://datatables.net/docs/DataTables/1.9.1/DataTable.defaults.html#fnServerData .

    So fnCallback( aoData ); in your example, assuming aoData is the object?

    Allan
  • AlekXLAlekXL Posts: 9Questions: 0Answers: 0
    well, I am bad in js. application programmer.
    [code]
    returnObj=serverMethods().getProds(sSource, aoData);
    [/code]

    serverMethods().getProds(sSource, aoData);
    do all the job. after called, I allready have all required data in returnObj
    in JSON OBJECT format.
    Assume that returnObj is complete json object, like above
    { "sEcho": 3, "iTotalRecords": 57...

    what exactly shoud I write , to pass this data to datatables?
  • AlekXLAlekXL Posts: 9Questions: 0Answers: 0
    edited July 2012
    http://i41.fastpic.ru/big/2012/0722/95/0665d8f8d979e664c93c14c1ee0d4695.png
  • AlekXLAlekXL Posts: 9Questions: 0Answers: 0
    OK. I ;ve figured out how it works
This discussion has been closed.