Answer the question
In order to leave comments, you need to log in
ExtJs 4 save filters in grid on getStore().reload()
Hello!
For grid filters I use ext.ux.grid.filtersfeature.
There is a problem. When the storage is restarted, the filters are reset.
I reload the store like this Ext.widget('itemslist').getStore().reload();
Filter configuration:
features: [{
ftype: 'filters',
autoReload: true,
encode: true,
local: false
}],
autoLoad: true,
storeId: 'ItemsStore',
remoteSort: true,
remoteFilter:true,
pageSize: 20,
proxy: {
type: 'ajax',
url: '/items/getlist',
reader: {
root: 'data',
totalProperty: 'totalCount',
type: 'json'
},
simpleSortMode: true
},
sorters: [{
property: 'item_name',
direction: 'DESC'
}],
autoLoad: true
Answer the question
In order to leave comments, you need to log in
Accidentally found the following solution
. Unfortunately, I have to access the object by id.
I can't figure out how to use this.
saveChangeItemConfig: function(button) {
var data = button.up('form').getForm().getValues();
console.log(data);
Ext.Ajax.request({
url: '/items/changeorcreateconfig',
method: 'GET',
params: data,
scope: this,
success: function(response, opts) {;
response = Ext.decode(response.responseText);
if(response.success==1){
Ext.getCmp('items_list_grid').filters.reload();
}else{
Ext.MessageBox.alert('Ошибка','Видимо произошла ошибка!');
}
},
failure: function(response, opts) {
alert('Ошибка!!');
}
});
},
saveChangeItemConfig: function(button) {
var data = button.up('form').getForm().getValues();
var grid = button.up('gridpanel');
//лучше сделать уникальный xtype для вашего грида
// var grid = button.up('z0091_gridpanel');
console.log(data);
console.log(grid);
Ext.Ajax.request({
url: '/items/changeorcreateconfig',
method: 'GET',
params: data,
scope: this,
success: function(response, opts) {;
response = Ext.decode(response.responseText);
if(response.success==1){
grid.getStore().filters.reload();
}else{
Ext.MessageBox.alert('Ошибка','Видимо произошла ошибка!');
}
},
failure: function(response, opts) {
alert('Ошибка!!');
}
});
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question