Muliti Select Ajax Json Post with Name Value Pairs

Muliti Select Ajax Json Post with Name Value Pairs

mbowermbower Posts: 2Questions: 0Answers: 0
edited October 2011 in TableTools
Hello All
I have a table that I need to post the column values out with a corresponding name... to be parsed with a php processor.
[code]
"oTableTools":
{
"sRowSelect": "multi",
"aButtons":
[
{
"sExtends": "ajax",
"bSelectedOnly": "true",
"sButtonText": "Mark As Billed",
"bHeader": false,
"mColumns": [ 3, 7, 8, 10, 11, 12, 13 ],//columns to export
"sAjaxUrl" : "../ajax_mysql_lib/markAsBilled.processor.php",
"fnClick": function( nButton, oConfig )
{
var sData = this.fnGetTableData(oConfig);
$.ajax(
{
"url": oConfig.sAjaxUrl,
"data": [

{ "name": "JobPO", "value": sData , },
],
"success": oConfig.fnAjaxComplete,
"dataType": "json",
"type": "POST",
"cache": false,
"error": function ()
{
alert( "Error detected when sending table data to server" );
}
} );
}
[/code]

This posts a single name:value pair with all selected rows mColumn data.
I need them in name value pairs so I can get them in the processor (ie: $_POST[column1]) and use in my query.

Anyway.. is there a way to loop through the sData, or use the mcolumns as a name reference? or sName??
What is best way to go about assigning (and posting) selected name value pairs???

Thanks!
-Matt B

Replies

  • mbowermbower Posts: 2Questions: 0Answers: 0
    OK, i didnt find an easy way to put out name/value pairs.... I ended up building indexed value array by exploding on \n and then exploding on \2. Hard to track tho
This discussion has been closed.