Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

jEditable does not recognize the ID column unless it is received as column [0]

$
0
0
This will work just fine:

$(document).ready(function () {


		    //Prepare dataTable
			var oTable = $('#EmployeeTitles').dataTable( {
				"aaSorting": [[1, 'asc']],
				"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
				"bJQueryUI": true,
				"bServerSide": false,
				"bProcessing": true,
				"sAjaxSource": "./DTemployeetitlesactions.php?action=list",
			    "sServerMethod": "POST",
				"aoColumns": [ { "mData": "0", "bSearchable": false, "bVisible": false, },
							   { "mData": "employeetitle" },
			                   ],
			    "sDom": '<"H"frT>t<"F"lip>',
		        "oTableTools": {
		            "sSwfPath": "../../Site/lib/Tabletools/media/swf/copy_csv_xls_pdf.swf",
		            "aButtons": [ "print", "pdf" ],
		            "sRowSelect": "single",
		           		           	 },
		             
		    }).makeEditable( {
				sUpdateURL: "./DTemployeetitlesactions.php?action=update",
			    sAddURL: "./DTmanagingofficesactions.php?action=create",
				sDeleteURL: "./DTmanagingofficesactions.php?action=delete",
				aoColumns: [{}, {}]
			});

				
			});

The resulting POST data will have the correct value associated with the "id". This method requires me to alter the SQL query to return the ID column as column name [0]. Ideally I would be able to return all column names as they are from SQL and specify which column in the dataset is the id to be passed in POST data transactions.

However, if I simply replace the mData name with the actual column name and allow SQL to pass the id column name unaliased the POST value for "id" will be blank.

"aoColumns": [ { "mData": "employeetitleid", "bSearchable": false, "bVisible": false, },
			{ "mData": "employeetitle" }, ],

Is there a way to specify the id column so that I do not have to alias the column name to [0] in SQL?

Viewing all articles
Browse latest Browse all 1816

Trending Articles