1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

bug #3912: Add create and showCreate commonActions

This commit is contained in:
Daniel Molina 2015-08-21 10:55:58 +02:00
parent 79b04e4f03
commit c4531fd587

View File

@ -19,6 +19,8 @@ define(function(require) {
CommonActions.prototype.del = _del;
CommonActions.prototype.multipleAction = _multipleAction;
CommonActions.prototype.singleAction = _singleAction;
CommonActions.prototype.create = _create;
CommonActions.prototype.showCreate = _showCreate;
return CommonActions;
@ -113,4 +115,32 @@ define(function(require) {
notify: true
}
}
function _create(formPanelId) {
var that = this;
return {
type: "create",
call: that.openNebulaResource.create,
callback : function(request, response) {
Sunstone.resetFormPanel(that.tabId, formPanelId);
Sunstone.hideFormPanel(that.tabId);
Sunstone.getDataTable(that.tabId).addElement(request, response);
},
error: function(request, response) {
Sunstone.hideFormPanelLoading(that.tabId);
Notifier.onError(request, response);
},
notify: true
}
}
function _showCreate(formPanelId) {
var that = this;
return {
type: "custom",
call: function() {
Sunstone.showFormPanel(that.tabId, formPanelId, "create");
}
}
}
});