ExtJS TextField values ​​represented as a string instead of an integer / number

I have an Ext Editor Grid with a NumberColumn. The column editor is installed in Ext.form.TextField. This grid is populated with JSON, and the data is transmitted as JSON.

My problem is that when the user enters a number in this column, it is sent as a string instead of a number. In other words, it looks like Property: "500" , and I want it, Property: 500 .

My column definition:

new Ext.grid.NumberColumn ({
            header: 'Area (ha)',
            dataIndex: 'Area',
            format: '0',
            width: 60,
            editor: new Ext.form.TextField({
                allowBlank: false
            })
        })

And the field definition for this column:

{ name: 'Area'}

I tried this but does nothing:

{ name: 'Area', type: 'int' }

Any ideas? Thank!

+3
source share
2 answers

. , Ext.form.NumberField. ExtJS, .

+3

, , , getValues .

Ext.form.Basic getFieldValues, , , POST'ing JSON ( ). numberfield , booleans ..

P.S. getFieldValues getValues; 4- useDataValues, , , , getFieldValues.

0

Source: https://habr.com/ru/post/1768469/


All Articles