Help needed at [login to view URL]
Javascript excerpt:
/ drag and drop functionality starts here /
$('#' + [login to view URL] + ' tbody').sortable({
start: function(event, ui) {
[login to view URL] = [login to view URL]();
},
stop: function(event, ui) {
[login to view URL]("Start position: " + [login to view URL]);
[login to view URL]("New position: " + [login to view URL]());
if([login to view URL] != [login to view URL]()) {
var table = $('#' + [login to view URL]).DataTable();
var start_row = [login to view URL][0].data();
var end_row = [login to view URL][[login to view URL]()].data();
[login to view URL](start_row);
[login to view URL](end_row);
/*
[login to view URL]("target row id: " + [login to view URL]([login to view URL]()).data('unique_id'));
[login to view URL]("target row id: " + [login to view URL]([login to view URL]()).data('unique_id'));
$.ajax({
url: postDT.ajax_url,
type: 'POST',
dataType: 'json',
data: {
action: 'DTMoveRow',
startrow: start_row['id'],
endrow: end_row['id']
},
success: function (return_data) {
[login to view URL]("success");
[login to view URL](return_data);
[login to view URL](return_data['success']);
[login to view URL](return_data['error']);
wpDataTables[tableid].fnDraw(false);
},
error: function(e) {
[login to view URL](e);
}
});
SwapRowValues([login to view URL], [login to view URL],[login to view URL], dttableid, [login to view URL], [login to view URL]());
*/
}
},
appendTo: "parent",
helper: "clone"
}).disableSelection(); // drag and drop ui ends here
==================================================
The original code, which I was debugging but am now replacing, is the call to SwapRowValues([login to view URL], [login to view URL],[login to view URL], dttableid, [login to view URL], [login to view URL]());
The function I'm eliminating got some data from the database and then invoked php function to do an update, which was failing.
My new design will have a much simpler php function that is called from this code snippet. Unfortunately, I'm having trouble getting proper values to pass to my php function. As you can see I'm using [login to view URL] to help me know what is going on.
The code above generates an error on the line
var start_row = [login to view URL][0].data();
I think the table object must not be getting fetched properly, but I copied its code from the function that used to be called here, substituting the parameters from the function call for the relevant arguments from the function...
I'm hoping I did something dumb that a simple code read-through will reveal. But I'd also love to have an experienced javascript debug person help me out with this on the test site.