[pve-devel] r6008 - pve-manager/pve2/www/new/form

svn-commits at proxmox.com svn-commits at proxmox.com
Mon May 23 11:56:00 CEST 2011


Author: dietmar
Date: 2011-05-23 11:56:00 +0200 (Mon, 23 May 2011)
New Revision: 6008

Added:
   pve-manager/pve2/www/new/form/TextField.js
Log:
impl.- text field which does not submit empty string


Added: pve-manager/pve2/www/new/form/TextField.js
===================================================================
--- pve-manager/pve2/www/new/form/TextField.js	                        (rev 0)
+++ pve-manager/pve2/www/new/form/TextField.js	2011-05-23 09:56:00 UTC (rev 6008)
@@ -0,0 +1,16 @@
+Ext.define('PVE.form.Textfield', {
+    extend: 'Ext.form.field.Text',
+    alias: ['widget.pvetextfield'],
+
+    skipEmptyText: true,
+
+    getSubmitValue: function() {
+	var me = this;
+
+        var value = this.processRawValue(this.getRawValue());
+	if (value !== '')
+	    return value;
+
+	return me.skipEmptyText ? null: value; 
+    }
+});
\ No newline at end of file




More information about the pve-devel mailing list