Plugin is another mechanism by which we can enhance/customize the behavior of an existing component. The new behavior is effective only if the plugin is added to the component. Otherwise, the base behavior remains intact. In this recipe, we will understand how to create a new plugin and use that on an existing component.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.
Carry out the following steps:
Create and open a new file
PhotoAlbumPlugIn.js
and paste the following code in it:Touch.book.ux.PhotoAlbumPlugIn = Ext.extend(Ext.util.Observable, { init: function(viewCmp) { viewCmp.tpl = new Ext.XTemplate( '<tpl for=".">', '<div class="thumb-wrap" id="{title}">', '<div class="thumb"><img src="{url}" title="{title}"></div>', '<span>{title}</span></div>...