using fnUpdate along with fnDrawCallback question
using fnUpdate along with fnDrawCallback question
So I have datatables setup for an ajax source, which it properly loads and initializes. Multiple rows will have a cell with a single button in it with a class of "order", that when clicked, initiates an ajax call to the server, and replaced the cell contents with the response, as well as replaces the cell in the next column over with another button (which will have its class added to fnDrawCallback once I get the first working)
I have a feeling that I'm using nRow incrrectly, but can't figure out how to change it to reference the cell itself correctly.
[code] fnDrawCallback: function( nRow, aData, iDisplayIndex) {
$(".order").click(function(){
var status = $(this);
var order_id = status.attr("data-id");
$.ajax({
url: "'.WWW_ROOT.'internal/ajax_orders.php?action=order&id="+order_id,
success: function(response) {
console.log(nRow);
dt_orders_active.fnUpdate(response, nRow, 6);
dt_orders_active.fnUpdate("Receive", nRow, 7);
}
});
});
}[/code]
I have a feeling that I'm using nRow incrrectly, but can't figure out how to change it to reference the cell itself correctly.
[code] fnDrawCallback: function( nRow, aData, iDisplayIndex) {
$(".order").click(function(){
var status = $(this);
var order_id = status.attr("data-id");
$.ajax({
url: "'.WWW_ROOT.'internal/ajax_orders.php?action=order&id="+order_id,
success: function(response) {
console.log(nRow);
dt_orders_active.fnUpdate(response, nRow, 6);
dt_orders_active.fnUpdate("Receive", nRow, 7);
}
});
});
}[/code]
This discussion has been closed.
Replies
Thanks!