PDA

View Full Version : GridPanel doesn't display all fields of an added record



bareflix
22 Jul 2010, 11:32 AM
I have a gridPanel that displayed rows of records in a DB table using a DirectStore. When I add a new record using a form, this is what I do in the save function:


this.getForm().updateRecord(this.record);

if (this.new_rec)
{
var store = list.getStore();
store.addSorted(this.record);
}
this.record.commit ();

The new row appears where it should be, it is stored in the DB correctly, but the only field which displays in the list is the ID field. I would understand it if it was the other way around, since the ID has to come back from the server.
Is there another call I need to make to get the Grid to update?

Also, is there a way to find the index where the new row was added so I can automatically select it in the Grid? Or any other way to find and select it?

Thanks
--
Chris Bare

bareflix
22 Jul 2010, 6:03 PM
OK, I've got it displaying properly now. My php backend create function was only returning the ID, not the whole record. Boy I wish the expected return data from direct CRUD functions was better documented.

Anyway, I would still like to be able to find and select the row I just inserted. Anyone have any ideas on that?