Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81669

Question about fnServerParams

$
0
0
Hello,

First, my compliments to Allan for Datatables. I'm gradually learning to use it those days and as I begin to understand the way it works, I must say I'm happy with it!

My question:
I'm wondering if there might be a bug in the fnServerParams function.

I tried to add custom variables to my Ajax calls to my server, in the way described in this example:
http://www.datatables.net/release-datatables/examples/server_side/custom_vars.html

"fnServerParams": function ( aoData ) {
	aoData.push( { "name": "table", "value": "wordforms" } );
}

Somehow it doesn't work.

But I discovered a post in the Datatables forum, which advises to add custom variables another way:
http://www.datatables.net/forums/discussion/6491/display-only-a-partial-list-from-db#Item_2

"fnServerData": function ( sSource, aoData, fnCallback ) {
	aoData.push( { "name": "table", "value": "wordforms" } );
		$.ajax( {
			"dataType": 'json', 
			"url": sSource, 
			"data": aoData, 
			"success": fnCallback
			} );
}

But as I understood in this post (http://www.datatables.net/forums/discussion/6475/repopulating-a-datatable-with-new-parameters/p1), the first solution is a replacement for the second.
So how come the first solution isn't working? Am I missing something?

Viewing all articles
Browse latest Browse all 81669

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>