In the previous recipe, we saw how to create DataView
and use XTemplate
and a store to generate the view. In this recipe, we will see if we have to show only the relevant items in the view, and how we go about approaching it.
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 named
ch04_05.js
and paste the following code into it:Ext.setup({ onReady: function() { var data = [{ album:'rose', url:'http://www.pictures.vg/vgflowers/400x300/flowers_pics_4870.jpg', title:'Rose 1', about:'Peach'}, … … , { album:'hibiscus', url:'http://www.pictures.vg/vgflowers/400x300/cflowers3224.jpg', title:'Hibiscus 1', about:'Bright Red'}]; var store = new Ext.data.JsonStore({ data: data, mode: 'local', fields: [ ...