View Full Version : Server returned values from json response are not shown in the grid for record.set()

30 Jan 2013, 12:06 PM
See controller code below.

1. Server saves some stuff in the database using a store and grid. (simple)
2. A form is attached to the grid for edit of a row, and a button for adding a new record.
3. The json WebService also generates some data in it's response (id and other fields) that should be updated in the store and shown in the grid on every sync.

Grid is displayed, form is opened clean using a button, fields are filled, form is saved. store.add() is used to create the record, Db returns sent values, also the generated fields, and all is displayed correctly in the grid.

Not working:
When form is loaded for existing record, values are updated, record.set() is used after which DB is updated normally, json returned the same as in the store.add situation.
The grid VIEW is NOT showing the values returned from the server this time. I want the full store record to be shown in my grid after the sync.

var form = button.up('form');var fullform = form.getForm();

if (fullform.isValid()){
var record = form.getRecord(),
values = form.getValues();

if (values.id !== ""){
else {
record = this.getAppNotesList().store.add(values);


else {
console.log('Form validation failed.');