PDA

View Full Version : Direct store and CRUD actions: incorrect update and how to insert id from server



biohazardo
24 Feb 2012, 2:53 AM
Update action fixed. Problem was is server methods.



DIRECT STORE
When I adding data to the store, it sends it to server. Server gives that record an ID. I need to show this added record in the grid with new ID.
Server send back all data with new ID, that it have revieved, but store nulls all this record, and show only null id in the grid without another data. I saw in console, that store doesn't have anything in that record. How to update ID and keep data for this new added record?

mitchellsimoens
24 Feb 2012, 12:25 PM
Is your question answered then?

biohazardo
24 Feb 2012, 1:46 PM
Is your question answered then?

No. I have the grid and direct store. With the form i'm adding new record into the store by .add() method. Direct store want to add new records, but it doesn't know the id (ID is generating by server). Store inserts records with ID 0. But server sends back new record data with generated ID. How I can insert this id into created record. It shows id 0, and all data null. But I need data from server. How to change old to new server's data?

biohazardo
26 Feb 2012, 10:35 PM
Is your question answered then?
Problem was in root property. Api class parsing json and returning result value. When I changed root to "data" it's work. Thanks)))