torsten@472: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz torsten@472: * Software engineering by Intevation GmbH torsten@472: * torsten@472: * This file is Free Software under the GNU GPL (v>=3) torsten@472: * and comes with ABSOLUTELY NO WARRANTY! Check out raimund@497: * the documentation coming with IMIS-Labordaten-Application for details. torsten@472: */ torsten@472: torsten@352: /** torsten@352: * Datetimepicker with german date format. torsten@352: */ raimund@497: Ext.define('Lada.view.widgets.Datetime', { raimund@542: extend: 'Ext.panel.Panel', raimund@490: alias: 'widget.datetime', raimund@542: raimund@542: layout: 'hbox', raimund@542: raimund@542: border: 0, raimund@490: torsten@31: initComponent: function() { raimund@542: var dateField = Ext.create('Ext.ux.form.DateTimeField', { raimund@542: format: 'd.m.Y', raimund@542: emptyText: 'Wählen Sie einen Zeitpunkt', raimund@542: fieldLabel: this.fieldLabel, raimund@542: margin: this.fieldMargin, raimund@542: labelWidth: this.labelWidth, raimund@542: flex: 1, raimund@542: name: this.name, raimund@542: listeners: this.listeners raimund@542: }); raimund@542: this.items = [{ raimund@542: xtype: 'image', raimund@542: name: 'warnImg', raimund@542: src: 'gfx/icon-warning.gif', raimund@542: margin: '2, 5, 2, 5', raimund@542: width: 16, raimund@542: height: 16, raimund@542: hidden: true raimund@542: }, { raimund@542: xtype: 'image', raimund@542: name: 'errorImg', raimund@542: src: 'gfx/icon-error.gif', raimund@542: margin: '2, 5, 2, 5', raimund@542: width: 16, raimund@542: height: 16, raimund@542: hidden: true raimund@542: }, dateField]; torsten@31: this.callParent(arguments); raimund@542: }, raimund@542: raimund@542: showWarnings: function(warnings) { raimund@542: var img = this.down('image[name=warnImg]'); raimund@542: Ext.create('Ext.tip.ToolTip', { raimund@542: target: img.getEl(), raimund@542: html: warnings raimund@542: }); raimund@542: img.show(); raimund@542: }, raimund@542: raimund@542: showErrors: function(errors) { raimund@542: var img = this.down('image[name=errorImg]'); raimund@542: Ext.create('Ext.tip.ToolTip', { raimund@542: target: img.getEl(), raimund@542: html: errors raimund@542: }); raimund@542: img.show(); torsten@31: } torsten@31: });