Hybrid View
-
9 Jan 2013 3:45 PM #1
Form: allowOnlyWhitespace doesn't affect formBind buttons w/o also allowBlank.
Form: allowOnlyWhitespace doesn't affect formBind buttons w/o also allowBlank.
REQUIRED INFORMATION
Ext version tested:- ext-4.1.1a-gpl
- Chrome 23.0.1271.101
Description:Code:<!DOCTYPE html>
- On form fields, setting allowOnlyWhitespace to false does not trigger buttons with formBind set to true to enable or disable based on the field validation. You must also set allowBlank to false, despite the fact that the documentation says setting allowOnlyWhitespace to false also sets allowBlank to false.
- Create form with one field with allowBlank and allowOnlyWhitespace set to false and a second field with only allowOnlyWhitespace set to false.
- Create a button on the form with formBind set to true.
- Both fields should be validated to have valid text before the button is enabled.
- Entering text for the first field (with both allowOnlyWhitespace and allowBlank set to false) enables the button.
Code:Ext.onReady(function() { var form = Ext.create('Ext.form.Panel', { plain: true, items: [ { xtype: 'textfield', fieldLabel: 'Field 1', name: 'field1', allowBlank: false, allowOnlyWhitespace: false }, { xtype: 'textfield', fieldLabel: 'Field 1', name: 'field2', allowOnlyWhitespace: false } ], buttons: [ { action: 'reset', text: 'Reset Form' }, { action: 'create', text: 'Create', formBind: true } ] }); var win = Ext.create('Ext.window.Window', { title: 'Form', minWidth: 300, minHeight: 200, layout: 'fit', items: form }); win.show(); });
HELPFUL INFORMATION
Additional CSS used:- only default ext-all.css
- OS X 10.8.2
-
9 Jan 2013 4:04 PM #2
This isn't a bug, that config didn't exist in 4.1.1a, it was introduced in 4.1.2.
To confirm, you can check out the 4.2 beta.Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote