Finish delete operation.

This commit is contained in:
Paulo Gustavo Veiga 2012-05-23 01:13:00 -03:00
parent fdc4a20667
commit 391c523b43
2 changed files with 7 additions and 21 deletions

View File

@ -49,20 +49,9 @@ jQuery.fn.dataTableExt.getSelectedRows = function() {
};
jQuery.fn.dataTableExt.removeSelectedRows = function() {
var mapIds = this.getSelectedMapsIds();
var trs = this.getSelectedRows();
jQuery.ajax({
async:false,
url: "../service/maps/batch?ids=" + mapIds.join(","),
type:"DELETE",
success : function(data, textStatus, jqXHR) {
trs.each(function() {
$('#mindmapListTable').dataTable().fnDeleteRow(this);
});
},
error: function() {
alert("Unexpected error removing maps. Refresh before continue.");
}
trs.each(function() {
$('#mindmapListTable').dataTable().fnDeleteRow(this);
});
};
@ -85,6 +74,7 @@ jQuery.fn.dialogForm = function(options) {
formData[elem.name] = elem.value;
});
var dialogElem = this;
jQuery.ajax(url, {
async:false,
dataType: 'json',
@ -100,9 +90,9 @@ jQuery.fn.dialogForm = function(options) {
window.location = redirectUrl;
} else if (options.postUpdate) {
options.postUpdate(formData);
}
dialogElem.modal('hide');
},
error: function(jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 400) {
@ -134,7 +124,7 @@ jQuery.fn.dialogForm = function(options) {
}.bind(this));
// Open the modal dialog ...
this.modal(options);
this.modal();
};
@ -146,7 +136,6 @@ function updateStatus() {
$("#mindmapListTable tbody input:checked").parent().parent().addClass('row-selected');
$("#mindmapListTable tbody input:not(:checked)").parent().parent().removeClass('row-selected');
// Update toolbar ...
$("#buttonsToolbar .act-multiple").hide();
$("#buttonsToolbar .act-single").hide();

View File

@ -77,7 +77,8 @@
bAutoWidth : false,
oLanguage : {
"sSearch" : "",
"sInfo" : "_START_-_END_ of _TOTAL_"
"sInfo" : "_START_-_END_ of _TOTAL_",
"sEmptyTable": "Hey, you don't have any mindmap. Go head and create one clicking the 'New' button !!!"
},
bStateSave:true
});
@ -115,7 +116,6 @@
$("#newBtn").click(
function() {
$("#new-dialog-modal").dialogForm({
modal: true,
redirect: "c/map/{header.resourceId}/edit.htm",
url : "../service/maps"
});
@ -140,7 +140,6 @@
// Initialize dialog ...
$("#duplicate-dialog-modal").dialogForm({
modal: true,
redirect: "c/map/{header.resourceId}/edit.htm",
url : "../service/maps/" + mapId
});
@ -167,7 +166,6 @@
// Initialize dialog ...
$("#rename-dialog-modal").dialogForm({
modal: true,
type: 'PUT',
postUpdate: function(reqBodyData) {
// Remove old entry ...
@ -190,7 +188,6 @@
if (mapIds.length > 0) {
// Initialize dialog ...
$("#delete-dialog-modal").dialogForm({
modal: true,
type: 'DELETE',
postUpdate: function(reqBodyData) {
// Remove old entry ...