2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
9 Ext.onReady(function(){
\r
10 Ext.menu.RangeMenu.prototype.icons = {
\r
11 gt: 'img/greater_then.png',
\r
12 lt: 'img/less_then.png',
\r
13 eq: 'img/equals.png'
\r
15 Ext.grid.filter.StringFilter.prototype.icon = 'img/find.png';
\r
17 // NOTE: This is an example showing simple state management. During development,
\r
18 // it is generally best to disable state management as dynamically-generated ids
\r
19 // can change across page loads, leading to unpredictable results. The developer
\r
20 // should ensure that stable state ids are set for stateful components in real apps.
\r
21 Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
\r
23 var ds = new Ext.data.JsonStore({
\r
24 url:'grid-filter.php',
\r
26 totalProperty: 'total',
\r
32 {name:'date',type: 'date', dateFormat: 'Y-m-d H:i:s'},
\r
36 sortInfo: {field: 'company', direction: 'ASC'},
\r
40 var filters = new Ext.grid.GridFilters({
\r
42 {type: 'numeric', dataIndex: 'id'},
\r
43 {type: 'string', dataIndex: 'company'},
\r
44 {type: 'numeric', dataIndex: 'price'},
\r
45 {type: 'date', dataIndex: 'date'},
\r
49 options: ['small', 'medium', 'large', 'extra large'],
\r
52 {type: 'boolean', dataIndex: 'visible'}
\r
55 var cm = new Ext.grid.ColumnModel([
\r
56 {dataIndex: 'id', header: 'Id'},
\r
57 {dataIndex: 'company', header: 'Company', id: 'company'},
\r
58 {dataIndex: 'price', header: 'Price'},
\r
59 {dataIndex: 'date',header: 'Date', renderer: Ext.util.Format.dateRenderer('m/d/Y')},
\r
60 {dataIndex: 'size', header: 'Size'},
\r
61 {dataIndex: 'visible',header: 'Visible'}
\r
63 cm.defaultSortable = true;
\r
65 var grid = new Ext.grid.GridPanel({
\r
67 title: 'Grid Filters Example',
\r
70 enableColLock: false,
\r
76 autoExpandColumn: 'company',
\r
77 bbar: new Ext.PagingToolbar({
\r
85 ds.load({params:{start: 0, limit: 15}});
\r