-
21 Feb 2011 9:03 AM #1
[FIXED]Ext.form.Basic.getValues()
[FIXED]Ext.form.Basic.getValues()
I was having some trouble with getting the proper values from comboboxes in my form. I found this override to fix the problem for me:
PHP Code:
Ext.override(Ext.form.Basic, {
getValues: function(asString, dirtyOnly, includeEmptyText) {
var values = {};
this.getFields().each(function(field) {
if (!dirtyOnly || field.isDirty()) {
var name = field.getName(),
//val = field.getSubmitValue(), // Gets raw value rather than actual value
val = field.getValue(), //My fix, which gets the proper value.
bucket;
if (val !== null) {
if (includeEmptyText && val === '') {
val = field.emptyText || '';
}
if (name in values) {
bucket = values[name];
if (!Ext.isArray(bucket)) {
bucket = values[name] = [bucket];
}
bucket.push(val);
} else {
values[name] = val;
}
}
}
});
if (asString) {
values = Ext.urlEncode(values);
}
return values;
},
});
-
22 Feb 2011 11:03 PM #2
This has been resolved, thanks for the report.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
23 Feb 2011 8:00 AM #3
I'm a little new at this, so can you help me understand what "resolved" means?
Did you fix it my way, or some other way? Can you post the final code block?
Best,
Michael
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
form.getValues - this.el is undefined
By ser in forum Ext 3.x: Help & DiscussionReplies: 10Last Post: 21 Oct 2010, 9:52 AM -
Ext.form.BasicForm.getValues() returns object if form is empty
By mrutz in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 22 Dec 2009, 2:31 AM -
[1.1] form.getValues() && emptyText
By nassaja-rus in forum Ext 1.x: BugsReplies: 13Last Post: 20 Aug 2009, 10:17 PM -
Extjs Form.getValues
By deepakjacob in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 15 Feb 2009, 8:36 AM


Reply With Quote