I created an HTML table list that uses jQuery sortable and droppable features. When I reorder the list by dragging a row to another location in the list, all works perfectly well. The PHP code called on by the jQuery ajax technique “.load()” works correctly too, and the server side table column gets updated with new “position” values, just like I want.
When I drag a row to the little trash bin div I created, the browser side responds correctly but the server side does not. I’m having trouble passing the correct values to the PHP code to trigger the isset($_POST[‘row’]) condition. I’ve tried with both .load() and .ajax() so far. I’m attempting the long form XMLHttpRequest code now.
I’ve given all the HTML table rows, and therefore the draggable row, an ‘id’ that makes sense according to a lot of the literature and forums I’ve read, for example: <tr id=“row_16”>. I’ve seen that the ‘name’ should be setup when constructing the params string to be sent as the data for the POST type request too: <tr name=“row_16”>.
What I’m trying to accomplish, and where my knowledge is lacking, is in getting this ‘id’ or ‘name’ related value of 16 to feed to the PHP code in order to create the SQL command that will delete the row in the database table of the server that corresponds with database table’s column id value of 16.
If I can fully understand what goes into creating the format for the data sent thru the XMLHttpRequest such as “data:…”, params or a serialized string and how PHP interprets them, I should be able to implement POSTs with any of the ajax techniques I’ve been exposed to so far.
Any insight on how these strings are created and packaged for PHP to be able to parse would be appreciated. Or if someone could point me to literature that does a good job of explaining this, I’d be grateful.
Sorry for the long winded question. I hope it’s clear though.