PDA

View Full Version : Please help! filters.js NOT FOUND!



gh_ost
30 Jan 2015, 9:22 AM
Hi all! When i add filter to grid, filters gives me GET 404 feature/filters.js not found :((
I have EXT.JS 4.2 version,
My code:

Ext.Loader.setConfig({ enabled: true });
Ext.Loader.setPath('Ext.ux', '/Jurstudy/public/js/ux');
Ext.require([
'Ext.*',
'Ext.grid.*',
'Ext.data.*',
'Ext.util.*',
'Ext.state.*',
'Ext.form.*',
'Ext.ux.grid.FiltersFeature',
]);

and

var filters = {
ftype: 'filters',
// encode and local configuration options defined previously for easier reuse
encode: false, // json encode the filter query
local: false, // defaults to false (remote filtering)


// Filters are most naturally placed in the column definition, but can also be
// added here.
};


and grid code:


var grid = Ext.create('Ext.grid.Panel',{
anchor: '100% 100%',
features: [filters],
title: '????????',
frame: true,
store: store,
id: 'grid',
columns: [
{
header: 'ID',
dataIndex: 'id',
width: 50,
sortable: true
},
{
header: '??? ???',
dataIndex: 'bar_code',
width: 50,
sortable: true,
editor: {
// defaults to textfield if no xtype is supplied
allowBlank: false
}
}, {
header: '???',
dataIndex: 'username',
width: 120,
filter: {
type: 'string'
// specify disabled to disable the filter menu
//, disabled: true
},
editor: {
allowBlank: false,
}
}, {
header: '???????',
dataIndex: 'last_name',
width: 140,
editor: {
allowBlank: false
}
}, {
header: '????????',
dataIndex: 'middle_name',
width: 140,
editor: {
allowBlank: false
}
},
{
dataIndex: 'name',
hidden: true,
menuDisabled: true
},
{
header: '?????????????',
dataIndex: 'profession_id',
width: 180,
renderer: function(a,b,rec){

return rec.data.name;
},
editor: {
xtype: 'combo',
mode: 'local',
store: professions,
triggerAction: 'all',
autoSelect: false,
editable: false,
displayField: 'name',
valueField: 'pr_id',
listeners:{
change: function(a,b,c)
{
groupStore.getProxy().extraParams.id = b;
Ext.getCmp('groups').getEditor().setDisabled(false);
}
}
}
},{
dataIndex: 'group_number',
hidden: true,
menuDisabled: true
},{
header: '??????',
id: 'groups',
dataIndex: 'group_id',
width: 80,
renderer: function(a,b,rec){
return rec.data.group_number;
},
editor: {
xtype: 'combo',
triggerAction: 'all',
store: groupStore,
allowBlank: false,
displayField: 'group_number',
valueField: 'gr_id',
disabled: true
}
}, {
xtype: 'datecolumn',
header: '???? ???????????',
dataIndex: 'enter_date',
width: 90,
editor: {
xtype: 'datefield',
allowBlank: true,
format: 'Y-m-d',
minValue: '01-01-2006',
minText: 'Cannot have a start date before the company existed!',
maxValue: '2100-01-01'
}
}, {
xtype: 'datecolumn',
header: '???? ?????????',
dataIndex: 'finish_date',
width: 90,
editor: {
xtype: 'datefield',
allowBlank: true,
format: 'Y-m-d',
minValue: '01-01-2006',
minText: 'Cannot have a start date before the company existed!',
maxValue: '2100-01-01'
}
}],
tbar: [{
text: '???????? ????????????',
iconCls: 'employee-add',
handler : function() {
rowEditing.cancelEdit();


// Create a model instance
var r = Ext.create('User', {
id: 'new',
'bar_code': '',
'username': '',
'last_name': '',
'middle_name': '',
'name': '',
'group_number': '',
'enter_date': Ext.Date.format(new Date(), 'Y/m/d'),
'finish_date': Ext.Date.format(new Date(), 'Y/m/d')
});

store.insert(0, r);
rowEditing.startEdit(0, 0);
}
}, {
itemId: 'removeEmployee',
text: '??????? ????????????',
iconCls: 'employee-remove',
handler: function() {
var sm = grid.getSelectionModel();
rowEditing.cancelEdit();
store.remove(sm.getSelection());
if (store.getCount() > 0) {
sm.select(0);
}
},
disabled: true
},{
itemId: 'search',
xtype: 'textfield',
width: 200,
listeners: {
change: function(a,b,c,d)
{
console.log(b);

}
}
}
],
bbar: Ext.create('Ext.PagingToolbar', {
store: store,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display"
})
,
plugins: [rowEditing],
listeners: {
'selectionchange': function(view, records) {
grid.down('#removeEmployee').setDisabled(!records.length);
}
}
});

Thanks

Gary Schlosberg
30 Jan 2015, 10:54 AM
Thanks for the report. Are you certain that the ux files exist in /Jurstudy/public/js/ux/ and have appropriate file permissions?