Sencha Touch Dynamic Model to accommodate schema changes

Sometimes data changes and your application has to accommodate this. Maybe you have fields that are user defined for example.  I have put together some code that would enable this on Sencha Touch, allowing for the fields in a model to be defined dynamically.

I have used fiddle.sencha.com for the first time to show this example. It can be found here.

The fiddle uses the same list and model and store but handles entirely different data. By changing three things (dynamicItemTpl, data[] array for the dynamicStore,  and data array in the fieldsStore) you can either show people or film titles in the list.  This is a very basic example, but you could feed all three into Sencha Touch to create your fields on the fly.

This is a quick post but hopefully the example is self explanatory. As always, any comments or questions are welcome.

Advertisements

4 thoughts on “Sencha Touch Dynamic Model to accommodate schema changes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s