
So the next question is: why don’t you just create one store and use it everywhere? There are two reasons: the filters are applied per store, adding filters to a store could affect elsewhere in the code if you are using the same store. The result of this is you can’t listen, globally, to see if anyone makes a change to the data. As well, events aren’t passed to stores that don’t perform the operation. The data can become stale in a store if there is another store accessing the data at the same time. This can be a little frustrating when using local data storage. Stores are confusing at first because they seem to be like an ORM but because they are designed mainly for AJAX interaction, they try desperately not to hit the data store. Stores – sync(), stale data, events, filtering All you need to do now is a ‘showBy’ call and the picker will be in a popover. The animations are disabled due to graphical glitches (see #8 above). This is useful when clicking on a text field and wanting to show a Picker. This is a simple key-value store which Sencha Touch will maintain for you. when it is hidden, remove it.īy far the easiest way to store data is to configure your model objects to use ‘localStorage’ to store your data. This ensures that the HTML elements are removed at that time, leaving no DOM clutter. This will ensure that the new panel is completely in view and the old one is completely hidden before destroying it. Another way, when removing panels from view, is to register an event handler on ‘hide’ to remove the panel from its parent. The documentation refers to it running ‘periodically’. Sencha Touch comes with the ability to ‘garbage collect’ orphaned components. You are better off using classes (property ‘cls’) to refer to panels. Even if you are transitioning from one to the other, the brief period where two exist is enough to trigger the bugs. If multiple objects having the same id are in the page, you will start to get unusual bugs. Multiple IDsĭo not use the ‘id’ parameter of an object in Sencha Touch unless you are sure that only one will exist. Not extremely hard to figure out but annoying if you have to replace the variables all over your code base. On Android, PhoneGap injects an object named ‘app’ that will overwrite your own.



Another blog article by me on Sench Touch and PhoneGap was recently posted on Codesta’s blog.ĭo not name your application ‘app’ like a lot of the examples do when using Sencha Touch.
