PDA

View Full Version : Setting model int field to null



K4T
13 May 2012, 2:51 AM
Hello! Could you tell me guys how to set model field which type is int to null as default value?


fields: [
{name: 'categoryId', type: 'int', defaultValue: null}, //still initialized to 0 not a null
],


Is it possible?

13 May 2012, 5:02 AM
null is not int! Setting a field type helps keep the value of that field within the valid data type.

mberrie
2 Oct 2012, 6:00 AM
The INT type supports a 'useNull' config.

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Field-cfg-useNull