Mar 15, 2011, 5:22 PM
Nullable int fields showing as zeroes
When I databind an object with an int? property to a store which includes the recordfield definition:
Why?
I can work around it but I'm surprised at the default behaviour of the RecordField. Looking at the ExtJS API docs for Ext.data.Field
(http://dev.sencha.com/deploy/dev/doc...Ext.data.Field) I notice a useNull config option
Or am I missing something?
<ext:RecordField Name="SomeIntId" Type="Int" />
I'll find that if SomeIntId is NULL in the database and hence NULL in my C# object, it ends up as 0 in the store's data rather than null.Why?
I can work around it but I'm surprised at the default behaviour of the RecordField. Looking at the ExtJS API docs for Ext.data.Field
(http://dev.sencha.com/deploy/dev/doc...Ext.data.Field) I notice a useNull config option
(Optional) Use when converting received data into a Number type (either int or float). If the value cannot be parsed,
null will be used if useNull is true, otherwise the value will be 0. Defaults to false
I don't see the equivalent Ext.NET property for useNull and RecordField doesn't have a CustomConfig property.Or am I missing something?