Code:
Ext.onReady(function(){
Ext.menu.RangeMenu.prototype.icons = {
gt: 'resources/images/greater_then.png',
lt: 'resources/images/less_then.png',
eq: 'resources/images/equals.png'
};
Ext.grid.filter.StringFilter.prototype.icon = 'resources/images/find.png';
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
var Terminal = Ext.data.Record.create([
{name: 'number'},
{name: 'address'},
{name: 'place'},
{name: 'price'},
{name: 'time_on'},
{name: 'time_off'},
{name: 'weekend'},
{name: 'paycount_yday'},
{name: 'paysum_yday'},
{name: 'paysum_yweek'},
{name: 'validator'},
{name: 'network'},
{name: 'category'},
{name: 'technick'}
]);
var xr = new Ext.data.XmlReader(
{record: 'terminal'},
Terminal
);
var ds = new Ext.data.Store({
url: 'data2.php',
reader: xr,
sortInfo: {field: 'number', direction: 'ASC'},
remoteSort: true
});
var filters = new Ext.grid.GridFilters({
filters:[
{type: 'numeric', dataIndex: 'number'},
{type: 'string', dataIndex: 'address'},
{type: 'string', dataIndex: 'place'},
{type: 'numeric', dataIndex: 'price'},
{type: 'string', dataIndex: 'time_on'},
{type: 'string', dataIndex: 'time_off'},
{type: 'string', dataIndex: 'weekend'},
{type: 'numeric', dataIndex: 'paycount_yday'},
{type: 'numeric', dataIndex: 'paysum_yday'},
{type: 'numeric', dataIndex: 'paysum_yweek'},
{
type: 'list',
dataIndex: 'validator',
options: ['1000', '1500'],
phpMode: true
},
{
type: 'list',
dataIndex: 'network',
options: ['МТС', 'Мегафон', 'Скайлинк', 'Локалка'],
phpMode: true
},
{
type: 'list',
dataIndex: 'category',
options: ['0', '1'],
phpMode: true
},
{
type: 'list',
dataIndex: 'technick',
options: ['0', '1'],
phpMode: true
}
]
});
var cm = new Ext.grid.ColumnModel([
{dataIndex: 'number', header: "number"},
{dataIndex: 'address', header: "address"},
{dataIndex: 'place', header: "place"},
{dataIndex: 'price', header: "price"},
{dataIndex: 'time_on', header: "time_on"},
{dataIndex: 'time_off', header: "time_off"},
{dataIndex: 'weekend', header: "weekend"},
{dataIndex: 'paycount_yday', header: "paycount_yday"},
{dataIndex: 'paysum_yday', header: "paysum_yday"},
{dataIndex: 'paysum_yweek', header: "paysum_yweek"},
{dataIndex: 'validator', header: "validator"},
{dataIndex: 'network', header: "network"},
{dataIndex: 'category', header: "category"},
{dataIndex: 'technick', header: "technick"}
]);
cm.defaultSortable = true;
var grid = new Ext.grid.GridPanel({
id: 'example',
title: 'qq',
ds: ds,
cm: cm,
enableColLock: false,
loadMask: true,
plugins: filters,
height:400,
width:700,
el: 'full-info',
autoExpandColumn: 'address',
bbar: new Ext.PagingToolbar({
store: ds,
pageSize: 15,
plugins: filters
})
});
grid.render();
ds.load({params:{start: 0, limit: 15}});
});
What's wrong?