I have 2 stores, one for events and one for data captured for that event. I am trying to get the id from the events store and use it in the data store. I have the following field in my data model:
{ name: ‘eventId’, type: ‘int’ },
My controller fetches the form data, validates it and after this, my code fails. I am trying the following to get the id from the first store and then set it in the second store
var idStore = Ext.getStore('Details');
var id = idStore.findRecord('id');
currentData.set('eventId', newValues.id);
My console returns null for var id, which leads me to believe that my code is wrong, can someone help explain to me how I fetch the id and use it?
Thanks
I figured it out, the docs Docs say to specify the value after the field. All I had to do was to add ‘1’ after the ‘id’ field.
This does raise some questions though, I have to ensure that my id’s always start with ‘1’, does anyone know of a better way?