PDA

View Full Version : Form Values to Store



Cougar84
24 May 2012, 12:00 AM
Let me explain ...

I've a grid ...
I select an element and I click Edit ...
It's open a window with a form and I put the row values in the form with:


var record = grid.getSelectionModel()[0]
form.loadRecord(record);


And it's work perfectly ...

Then I edit the value in the form and I want to save in the store ...

But the form doesn't have a Model, but only a object with the values:


form.getValues();


It's possible to load this value in a model in a one command like loadRecord way?

Thanks,
Marco

vietits
24 May 2012, 1:03 AM
It seems what you mention is <form>.updateRecord() (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.Basic-method-updateRecord).

Cougar84
24 May 2012, 1:29 AM
To future Memory:

First:


form.loadRecord(record);


edit the values

then in the save button


form.getForm().updateRecord();


Thanks,
Marco