FilterProxy.js - helper class

This commit is contained in:
Dietmar Maurer 2017-09-05 10:50:39 +02:00
parent 0dd929ecad
commit 2f5b0b8ae4
2 changed files with 27 additions and 0 deletions

26
js/FilterProxy.js Normal file
View File

@ -0,0 +1,26 @@
Ext.define('PMG.FilterProxy', {
extend: 'Proxmox.RestProxy',
alias : 'proxy.pmgfilterproxy',
filterId: undefined, // 'x-gridfilter-XXXXX'
getParams: function(operation) {
var me = this, i;
if (!operation.isReadOperation) {
return {};
}
var params = me.callParent(arguments);
var filters = operation.getFilters() || [];
for (i = 0; i < filters.length; i++) {
filter = filters[i];
if (filter.config.id === me.filterId) {
var v = filter.getValue();
if (v !== undefined && v !== '') {
params.filter = v;
}
}
}
return params;
}
});

View File

@ -1,5 +1,6 @@
JSSRC= \
Utils.js \
FilterProxy.js \
LoginView.js \
RoleSelector.js \
ServerStatus.js \