views:

15

answers:

1

I have an Ext Editor Grid with a NumberColumn. The column's editor is set to an Ext.form.TextField. This grid is populated by JSON and data is submitted 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 this Property: "500" and what I want is this, 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've tried this but it does nothing:

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

Any ideas? Thanks!

+2  A: 

Found a resolution. Apparently there's a Ext.form.NumberField. It's not listed in the ExtJS documentation, I had to search for it.

Brady
http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.NumberField
bmoeskau