From 7e9d5eb53783827d3f7c705009beafe12b59aa84 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Fri, 30 Sep 2011 19:42:09 +0100 Subject: [PATCH] Examples: Add JSONP examples for the 'id's and 'objects' sever-side scripts. Might make all JSONP compatible at some point... --- examples/server_side/scripts/id_jsonp.php | 179 ++++++++++++++++++ .../server_side/scripts/objects_jsonp.php | 176 +++++++++++++++++ 2 files changed, 355 insertions(+) create mode 100644 examples/server_side/scripts/id_jsonp.php create mode 100644 examples/server_side/scripts/objects_jsonp.php diff --git a/examples/server_side/scripts/id_jsonp.php b/examples/server_side/scripts/id_jsonp.php new file mode 100644 index 00000000..4d4d2fd3 --- /dev/null +++ b/examples/server_side/scripts/id_jsonp.php @@ -0,0 +1,179 @@ + intval($_GET['sEcho']), + "iTotalRecords" => $iTotal, + "iTotalDisplayRecords" => $iFilteredTotal, + "aaData" => array() + ); + + while ( $aRow = mysql_fetch_array( $rResult ) ) + { + $row = array(); + + // Add the row ID and class to the object + $row['DT_RowId'] = 'row_'.$aRow['id']; + $row['DT_RowClass'] = 'grade'.$aRow['grade']; + + for ( $i=0 ; $i \ No newline at end of file diff --git a/examples/server_side/scripts/objects_jsonp.php b/examples/server_side/scripts/objects_jsonp.php new file mode 100644 index 00000000..7b403bad --- /dev/null +++ b/examples/server_side/scripts/objects_jsonp.php @@ -0,0 +1,176 @@ + intval($_GET['sEcho']), + "iTotalRecords" => $iTotal, + "iTotalDisplayRecords" => $iFilteredTotal, + "aaData" => array() + ); + + while ( $aRow = mysql_fetch_array( $rResult ) ) + { + $row = array(); + for ( $i=0 ; $i \ No newline at end of file