}
},
+ popupErrorDialog: function(responseText) {
+ $("#xos-error-dialog").html(templateFromId("#xos-error-response")($.parseJSON(responseText)));
+ $("#xos-error-dialog").dialog({
+ modal: true,
+ buttons: {
+ Ok: function() { $(this).dialog("close"); }
+ }
+ });
+ },
+
showError: function(result) {
result["statusclass"] = "failure";
if (this.logTableId) {
this.appendLogWindow(result);
+ this.popupErrorDialog(result.responseText);
} else {
+ // this is really old stuff
$(this.errorBoxId).show();
$(this.errorBoxId).html(_.template($(this.errorTemplate).html())(result));
var that=this;
$(this.statusMsgId).html( templateFromId("#xos-status-template")(result) );
}
+ limitTableRows(this.logTableId, 5);
+
return logMessageId;
},
},\r
\r
saveError: function(model, result, xhr, infoMsgId) {\r
- result["what"] = "save " + model.__proto__.modelName;\r
+ result["what"] = "save " + model.modelName + " " + model.attributes.humanReadableName;\r
result["infoMsgId"] = infoMsgId;\r
this.app.showError(result);\r
},\r
\r
saveSuccess: function(model, result, xhr, infoMsgId) {\r
result = {status: xhr.xhr.status, statusText: xhr.xhr.statusText};\r
- result["what"] = "save " + model.__proto__.modelName;\r
+ result["what"] = "save " + model.modelName + " " + model.attributes.humanReadableName;\r
result["infoMsgId"] = infoMsgId;\r
this.app.showSuccess(result);\r
},
destroyError: function(model, result, xhr, infoMsgId) {
- result["what"] = "destroy " + model.__proto__.modelName;\r
+ result["what"] = "destroy " + model.modelName + " " + model.attributes.humanReadableName;\r
result["infoMsgId"] = infoMsgId;\r
this.app.showError(result);\r
},\r
\r
destroySuccess: function(model, result, xhr, infoMsgId) {\r
result = {status: xhr.xhr.status, statusText: xhr.xhr.statusText};\r
- result["what"] = "destroy " + model.__proto__.modelName;\r
+ result["what"] = "destroy " + model.modelName + " " + model.attributes.humanReadableName;\r
result["infoMsgId"] = infoMsgId;\r
this.app.showSuccess(result);\r
},
save: function() {
this.app.hideError();
- var infoMsgId = this.app.showInformational( {what: "save " + this.model.__proto__.modelName, status: "", statusText: "in progress..."} );\r
+ var infoMsgId = this.app.showInformational( {what: "save " + model.modelName + " " + model.attributes.humanReadableName, status: "", statusText: "in progress..."} );\r
var data = Backbone.Syphon.serialize(this);\r
var that = this;\r
var isNew = !this.model.id;\r
destroyModel: function() {
this.app.hideError();
- var infoMsgId = this.app.showInformational( {what: "destroy " + this.model.__proto__.modelName, status: "", statusText: "in progress..."} );
+ var infoMsgId = this.app.showInformational( {what: "destroy " + model.modelName + " " + model.attributes.humanReadableName, status: "", statusText: "in progress..."} );
var that = this;
this.model.destroy({error: function(model, result, xhr) { that.destroyError(model,result,xhr,infoMsgId);},
success: function(model, result, xhr) { that.destroySuccess(model,result,xhr,infoMsgId);}});