PDA

View Full Version : Store updaterecord event not firing for me



parky128
16 Jul 2013, 5:00 AM
Hi,

I have a list bound to a store, and can see the list items update and re-sort when I call load on my store. But I also have an event listener for the updaterecord event on the store, but it never fires for me.

I have set the idProperty on the model for my store to match a field coming back in the JSON response when calling load on the store, but I notice the id property on my model instance remains as the auto assigned ones when stepping through store items in Chrome.

If however I add an idProperty to the reader config on my store, I see a new 'id' field appear in my model instances when stepping through in Chrome, but the id property on my model is still the auto assigned one. Plus I see an internalId property appear which matches the value of the field I used as my idProperty in the reader config.

Does this mean the id property on the model instances are not getting updated correctly which would cause them to not get committed to the store and therefore the updaterecord event does not fire?

mitchellsimoens
18 Jul 2013, 3:33 AM
If you are talking about the record.id property, it will be the auto assigned on. record.internalId should be the value returned in the response.

parky128
18 Jul 2013, 3:38 AM
Ok, I understand that, but I don't understand why the updaterecord event does not fire on the store. It's as if the modified records are not getting committed to the store.