how to refresh a jquery Datatable after an operation ?
Hi, I have a datatable, the first column show agencies assigned to this row, in another column I have a button that when clicked show a form to assign new agencies to this row, everything work well, but for the new agencies added I have to refresh the page to see them, is there any way to add them as soon as I click the button "Assign" ?
here is an image showing what I am talking about :
http://s18.postimg.org/9xtvp7w6x/rr_Agency.png
Thanks.
- $("#divPopUp").dialog({
- resizable: true,
- autoOpen: false,
- height: 500,
- width: 550,
- modal: true,
- buttons: {
- "Assign": function () {
- var agenciesId = $(this).find(":checkbox:checked").map(function () {
- return this.value;
- }).get();
- //alert("agenciesId :" + agenciesId);
- var ruleIDd = $("#divPopUp").data('param_1');
- $.ajax({
- url: 'assignRenameRuleToAgency.do',
- data: {"agenciesId": agenciesId,"ruleId":ruleIDd },
- success: function(response) {
- toastr.success(response.message);
- }
- }) ;
- oTable.draw();
- $(this).dialog("close");
- },
- Cancel: function () {
- $(this).dialog("close");
- }
- },
- close: function () {
- $(this).find(":checkbox").removeAttr('checked');
- $(this).dialog("close");
- }
- });