PDA

View Full Version : [OPEN] Number Field (numberfield) Missing Methods



craigatx
12 Nov 2011, 8:46 PM
I'm using Designer 2, and I think the config it is generating is correct for a number field:

{
xtype: 'numberfield',
id: 'Principal',
itemId: 'Principal',
label: 'Principal',
placeHolder: 'Dollars'
}

but console.log of the object shows it is missing some methods (i.e. getSubmitValue(), etc.):
Object
_baseCls: "x-field"
_clearIcon: true
_component: Object
_hidden: false
_isClearIconInitialized: true
_isComponentInitialized: true
_isLabelInitialized: true
_isLabelWidthInitialized: true
_isPlaceHolderInitialized: true
_isRequiredInitialized: true
_isUiInitialized: true
_label: "Principal"
_labelWidth: "30%"
_placeHolder: "Dollars"
_required: false
_requiredCls: "x-field-required"
_styleHtmlCls: "x-html"
_ui: "number"
_value: "22"
componentElement: Object
config: Object
element: Object
eventDispatcher: Object
getBaseCls: function () {
getCentered: function () {
getClearIcon: function () {
getComponent: function () {
getDisabled: function () {
getDocked: function () {
getEventDispatcher: function () {
getHeight: function () {
getHidden: function () {
getId: function () {
getObservableId: function () {
getRequired: function () {
getRequiredCls: function () {
getStyleHtmlContent: function () {
getUi: function () {
getUniqueId: function () {
id: "Principal"
initConfig: function () {}
initialConfig: Object
initialized: true
innerElement: Object
isBubblingEnabled: Object
itemId: "Principal"
label: Object
managedListeners: Object
observableId: "#Principal"
originalValue: 0
parent: Object
referenceList: Array[3]
renderElement: Object
rendered: true
usedSelectors: Array[1]
__proto__: Object

Am I crazy here?

craigatx
12 Nov 2011, 8:57 PM
This code:


var principalField = this.query('#Principal')[0];
console.log(principalField.getId());
console.log(principalField.getRawValue());

Generates:


Principal
TypeError: 'undefined' is not a function (evaluating 'principalField.getRawValue()')

Jamie Avins
14 Nov 2011, 9:31 AM
Thank you for the report.

rdougan
14 Nov 2011, 4:49 PM
I just searched the whole source code of 1.1, and there are no mentions of a getSubmitValue or getRawValue method for a number field (or any field).

As for your other post, it seems 'var principalField = this.query('#Principal')[0];' is returning undefined, so your code is dying. Make sure your this.query is in the correct place. A quick check would be to run Ext.getCmp('Principal');