Wednesday, 18 September 2013

Extjs: Setting an object's data to be shown in a form

Extjs: Setting an object's data to be shown in a form

I currently have an object with various fields (mostly date fields) as
shown from the console log below. There are more fields than this but all
are similar. Also I am aware that they are all 1970 this is how we set
them on the .net side.
Object {
gasSafeLicenseNo: "3132571",
ngDomesticPipework: "1970-01-01T00:00:00",
lpgDomesticPipework: "1970-01-01T00:00:00"
lpgCentralHeating: "1970-01-01T00:00:00"
lpgDomesticBoats: "1970-01-01T00:00:00"
lpgDomesticCaravans: "1970-01-01T00:00:00"
I have a view with a form in holding all the date fields etc etc..
{
xtype: 'datefield',
labelWidth: 50,
name: 'ngDomesticPipework',
fieldLabel: 'NG'
},
All fields have identical names in the model, view and data object but
will not load into my form ready for editing. I am simply getting the form
element with a component query setting the data to be the object I want to
load and calling load record.
var data = record.get('engineer').gasSafeCard;
gasSafeFormCmp.loadRecord(data);
Thanks folks massive help as always.

No comments:

Post a Comment