Mercurial > lada > lada-client
changeset 544:d2e90f117c20
updated error and warning handling.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 18 Dec 2014 15:04:21 +0100 (2014-12-18) |
parents | ce188e2fab06 |
children | 7c9475119861 |
files | app/view/widgets/LadaForm.js |
diffstat | 1 files changed, 6 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/app/view/widgets/LadaForm.js Thu Dec 18 15:03:51 2014 +0100 +++ b/app/view/widgets/LadaForm.js Thu Dec 18 15:04:21 2014 +0100 @@ -100,8 +100,8 @@ }, commit: function() { - if (this.form.isDirty() && this.form.isValid()) { - + if (this.form.isDirty() && + this.form.isValid()) { var data = this.model.getAllData(); var baseUrl = this.model.getProxy().url; var url = baseUrl; @@ -223,46 +223,15 @@ }, createMessages: function() { - var messages = Ext.create('Ext.form.Panel', { - bodyPadding: '5 5 5 5' - }); var key; - var label; for (key in this.warnings) { - label = Ext.create('Ext.container.Container', { - layout: 'hbox', - bodyPadding: '5 5 5 5', - items: [{ - xtype: 'image', - src: 'gfx/icon-warning.gif', - width: 18, - height: 18 - }, { - xtype: 'label', - text: key + ': ' + this.warnings[key], - margin: '4 0 0 5' - }] - }); - messages.insert(0, label); + var element = this.down('component[name=' + key + ']'); + element.showWarnings(this.warnings[key]); } for (key in this.errors) { - label = Ext.create('Ext.container.Container', { - layout: 'hbox', - bodyPadding: '5 5 5 5', - items: [{ - xtype: 'image', - src: 'gfx/icon-error.gif', - width: 18, - height: 18 - }, { - xtype: 'label', - text: key + ': ' + this.errors[key], - margin: '4 0 0 5' - }] - }); - messages.insert(0, label); + var element = this.down('component[name=' + key + ']'); + element.showErrors(this.errors[key]); } - this.insert(0, messages); }, updateOnChange: function() {