PDA

View Full Version : NumberField problem with loadRecord()



bozzoz
30 Apr 2011, 9:31 PM
Hi, I have got a grid with some float and int columns. When I try to load a record in a form with method


myForm.getForm().loadRecord(record)

the NumberField with null value in the record display 0.

Why the field does not show the empty value?

Thanks

friend
2 May 2011, 10:11 AM
If the store which backs your grid declares a field as float or int, then you're telling it to expect a number, where null is functionally equivalent to a zero.

If you declare your store fields without a type, they'll default to String and you'll get the desired effect (except all values will be handled as Strings).

bozzoz
2 May 2011, 10:29 PM
Ok but if my numberField allow blank value, how to fill it with blank value when float value in the store is null?