]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * @class Ext.chooser.IconBrowser\r | |
3 | * @extends Ext.view.View\r | |
4 | *\r | |
5 | * This is a really basic subclass of Ext.view.View. All we're really doing here is providing the template that dataview\r | |
6 | * should use (the tpl property below), and a Store to get the data from. In this case we're loading data from a JSON\r | |
7 | * file over AJAX.\r | |
8 | */\r | |
9 | Ext.define('Ext.chooser.IconBrowser', {\r | |
10 | extend: 'Ext.view.View',\r | |
11 | alias: 'widget.iconbrowser',\r | |
12 | \r | |
13 | uses: 'Ext.data.Store',\r | |
14 | \r | |
15 | singleSelect: true,\r | |
16 | overItemCls: 'x-view-over',\r | |
17 | itemSelector: 'div.thumb-wrap',\r | |
18 | tpl: [\r | |
19 | // '<div class="details">',\r | |
20 | '<tpl for=".">',\r | |
21 | '<div class="thumb-wrap">',\r | |
22 | '<div class="thumb">',\r | |
23 | '<img src="icons/{thumb}" />',\r | |
24 | '</div>',\r | |
25 | '<span>{name}</span>',\r | |
26 | '</div>',\r | |
27 | '</tpl>'\r | |
28 | // '</div>'\r | |
29 | ],\r | |
30 | \r | |
31 | initComponent: function() {\r | |
32 | this.store = Ext.create('Ext.data.Store', {\r | |
33 | autoLoad: true,\r | |
34 | fields: ['name', 'thumb', 'url', 'type'],\r | |
35 | remoteSort: false,\r | |
36 | sorters: 'type',\r | |
37 | proxy: {\r | |
38 | type: 'ajax',\r | |
39 | url : 'icons.json',\r | |
40 | reader: {\r | |
41 | type: 'json'\r | |
42 | }\r | |
43 | }\r | |
44 | });\r | |
45 | \r | |
46 | this.callParent(arguments);\r | |
47 | }\r | |
48 | }); |