Hello,
Firstable I doesn't speak english very well so I apologize in advance.
I try to make a grid panel with an add line button on tbar.
When i click on this button extjs send to my server (POST METHOD) a json with parms like that :
Code:
{"idP":4,"items":[{"statut":"","pbjs":"000000","av_ap":"","description":"","jour":"2011-10-02T00:00:00","nbj":"1"}]}
And my java server return
Code:
{"items":[{"id":2,"statut":"","description":"","av_ap":"","nbj":"1","jour":"02\/10\/2011","pbjs":"000000"}],"success":true}
My problem is when i click on this button very fast :
Extjs does not wait the server to finish the first request so it does not yet receive the success proprety.
Then the second request is an array of items with the item of my first request and the item of my second request.
The item of my fisrt request has been created but extjs does not wait for the success proprety and send item of my first request a second time on my second request.
So the item of my first request is created twice...
Here is an exemple :
First request :
Code:
{{"idP":4,"items":[{"statut":"","pbjs":"000000","av_ap":"","description":"","jour":"2011-10-06T00:00:00","nbj":"1"}]}
Second request :
Code:
{"idP":4,"items":[{"statut":"","pbjs":"000000","av_ap":"","description":"","jour":"2011-10-07T00:00:00","nbj":"1"},{"statut":"","pbjs":"000000","av_ap":"","description":"","jour":"2011-10-06T00:00:00","nbj":"1"}]}
Does anybody have a solution ?
Thanks
,
Jims
Edit :
Problem solved with the store.commitChanges() method.