I've searched this form and online extensively looking for a way to add fields to my model dynamically. I found many posts on the topic but no concrete working solution.
This is my model, I only know one field upfront, the rest I have to set based on a configuration that I retrieve.
No I cannot define all the fields upfront, it must be dynamic. By the way I got this working in an extjs 4 app so I'm confused as to why it isnt working with touch2.
I found one post recommending this approach:
However it did not work for me!
var myModel = Ext.ModelManager.getModel('CVM.model.ListDetailMod');
Why cant I just do something like this? (which does not work by the way, but I found a slight variation worked for my grid model in extjs4).
In both scenarios I know they dont work because the records are not populated by my store. However if I hard code the one "ItemId" field on my model and try to set the rest dynamically I do see data for "ItemId" but not for any of the other ones. If I set all fields on my model dynamically including "ItemId" then my store records dont have any data i.e. when I do store.getAt(0).get("ItemId") I get "undefined".
var fieldsArray = new Array();
var model = Ext.ModelManager.getModel('CVM.model.ListDetailMod');
Thanks for the help.