In my Application (ExtJS 4.2.1) I have a window for creating a new record and save it to database.
When I create the window and show it I create a new record and assign it to the window form record:
onNewPunchClick: function(button, e, options) {
var me = this;
var win = Ext.create('App.view.attendance.punch.EditPunch'),
editForm = win.down('#editForm');
var newRec = Ext.create('App.model.attendance.DailyTime', {
AttendanceId: 0,
EmployeeId: 0,
SensorId: 0,
IsManual: true,
IsActive: true
});
// load record to form
editForm.loadRecord(newRec);
win.show();
},
Then my form is displayed but some fields has "0" like this:
So I was trying to workaround but I can't get it working fine:
I have tried using the
convert
function in the model that returns' '
when 0 value.I also have tried to use the
defaultValue
in the model without any success.I also have tried to set
EmployeeId: ''
, when creating the model with no success.
There should something that I'm missing, any help is really appreciated.