From 2a5d7aa97a09f00ba66b4e957577497dc4bdcab9 Mon Sep 17 00:00:00 2001 From: Renaud Le Gac <legac@cppm.in2p3.fr> Date: Tue, 26 Nov 2013 18:10:30 +0100 Subject: [PATCH] ExtJS 4.2: clean the code. --- static/plugin_dbui/src/form.js | 100 --------------------------------- 1 file changed, 100 deletions(-) diff --git a/static/plugin_dbui/src/form.js b/static/plugin_dbui/src/form.js index 4c384f0b..10c7e105 100644 --- a/static/plugin_dbui/src/form.js +++ b/static/plugin_dbui/src/form.js @@ -261,106 +261,6 @@ Ext.define('App.form.FormPanel', { return; } } - - /* - var i, - field, - fieldName, - form = this.getForm(), - msg = '', - records, - title; - - switch (type) { - case 'response': - // invalid response from the server, HTTP 400, 500 - Ext.Msg.alert(this.textError, this.textServerError); - break; - - case 'remote': - // invalid response from the server, HTTP 400, 500 - if (response.hasOwnProperty('xhr')) { - Ext.Msg.alert(this.textError, response.xhr.responseText); - return; - } - - // valid answer from the server, HTTP 200 - // but something went wrong in the server validation process, ... - // build error message - switch (typeof (response.errors)) { - case "string": - msg += response.errors; - msg += '<br>'; - break; - - case "object": - - // A list - if (Ext.isArray(response.errors)) { - for (i = 0; i < response.errors.length; i += 1) { - msg += response.errors[i]; - msg += '<br>'; - } - break; - } - - // A dictionary - // mark fields invalid - // concatenate error messages - for (fieldName in response.errors) { - if (response.errors.hasOwnProperty(fieldName)) { - - field = form.findField(fieldName); - if (field) { - field.markInvalid(response.errors[fieldName]); - } - - msg += response.errors[fieldName]; - msg += '<br>'; - } - } - break; - } - - // inform the user - // Keep the store in synchronization with the database - records = arg; - - switch (action) { - case 'create': - for (i = 0; i < records.length; i += 1) { - this.store.remove(records[i]); - } - - msg += this.textCreateErrorAction; - msg += '<br>'; - title = this.textCreateFailed; - break; - - case 'destroy': - msg += this.textDeleteErrorAction; - msg += '<br>'; - title = this.textDeleteFailed; - break; - - case 'update': - for (i = 0; i < records.length; i += 1) { - records[i].reject(); - } - - msg += this.textUpdateErrorAction; - msg += '<br>'; - title = this.textUpdateFailed; - break; - } - - msg += this.textDbAction; - - // inform the user - Ext.Msg.alert(title, msg); - - break; - } */ }, /** -- GitLab