Sending Name/Value parameters for selected row
Sending Name/Value parameters for selected row
Hello, I'm trying to figure out how to have datatables send all the name/value as parameters when doing an ajax call. Here's what I got below. Setting data as aData sends undefined=undefined.
[code]
$('#btnUpdateRow').click( function() {
var anSelected = fnGetSelected( oTable );
var iRow = oTable.fnGetPosition( anSelected[0] );
var aData = oTable.fnGetData(iRow);
$.ajax({
type: 'POST',
url: 'update_user',
data: aData,
async: false,
datatype: 'html',
success: function(response) {
}
});
});
[/code]
[code]
$('#btnUpdateRow').click( function() {
var anSelected = fnGetSelected( oTable );
var iRow = oTable.fnGetPosition( anSelected[0] );
var aData = oTable.fnGetData(iRow);
$.ajax({
type: 'POST',
url: 'update_user',
data: aData,
async: false,
datatype: 'html',
success: function(response) {
}
});
});
[/code]
This discussion has been closed.
Replies
And finally ('cos there is always one more :-) ), you don't need to use fnGetPosition in the above code. Just use fnGetData( anSelected[0] ) - it does exactly the same thing (fnGetData can take a TR node as the parameter to look up).
Allan