Moving items from datatable 1 to datatable 2
Moving items from datatable 1 to datatable 2
luisrortega
Posts: 79Questions: 6Answers: 1
Hi Guys,
I just need some basic directions on how to implement this...
I have a page with two side by side datatables, I retrieve the data myself for both tables (no php on the back end)... there are 2 buttons between them (one pointing to left, another to right).. The intention is to have the customer select multiple lines from either table, press a button and have the software move them across table.
Tks,
Luis
I just need some basic directions on how to implement this...
I have a page with two side by side datatables, I retrieve the data myself for both tables (no php on the back end)... there are 2 buttons between them (one pointing to left, another to right).. The intention is to have the customer select multiple lines from either table, press a button and have the software move them across table.
Tks,
Luis
This discussion has been closed.
Replies
Allan
Allan
[code]
function BackLogLeftClick(){
var oTT = TableTools.fnGetInstance( 'HomeBacklog2' );
var SelItems = oTT.fnGetSelected();
if (SelItems.length > 0) {
//retreive item list
var itemlist = [];
var SelItemsData = oTT.fnGetSelectedData();
for (item in SelItemsData){
itemlist.push(SelItemsData[item].id );
};
//post to server...
$.post( "Data.php?tbl=12", { action: 'sprint', items: itemlist, sprint: "" })
.fail(function(xhr, textStatus, errorThrown) {
alert(xhr.responseText);
})
.done(function( data ) {
// alert( "Data Loaded: " + data );
// remove items from left table
for (item in SelItems){
HomeBacklog2T.fnDeleteRow(SelItems[item],null, false);
};
// add items to second table
HomeBacklogT.fnAddData(SelItemsData);
// force redraw on left table (since false was passed to fnDeleteRow...)
HomeBacklog2T.fnDraw();
});
}
return false;
}
[/code]