clear filter after repository creation, see #48

This commit is contained in:
Sebastian Sdorra
2011-09-05 11:49:23 +02:00
parent 43962eb508
commit f81ab4f5d1
2 changed files with 22 additions and 1 deletions

View File

@@ -123,6 +123,13 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
this.filterStore();
},
clearStoreFilter: function(){
this.searchValue = null;
this.typeFilter = null;
this.getStore().clearFilter();
},
filterStore: function(){
var store = this.getStore();
if ( ! this.searchValue && ! this.typeFilter ){

View File

@@ -87,6 +87,7 @@ Sonia.repository.Panel = Ext.extend(Sonia.rest.Panel, {
xtype: 'label',
text: 'Filter: '
}, ' ', {
id: 'repositoryTypeFilter',
xtype: 'combo',
hiddenName : 'type',
typeAhead: true,
@@ -112,6 +113,7 @@ Sonia.repository.Panel = Ext.extend(Sonia.rest.Panel, {
xtype: 'label',
text: 'Search: '
}, ' ',{
id: 'repositorySearch',
xtype: 'textfield',
enableKeyEvents: true,
listeners: {
@@ -218,12 +220,24 @@ Sonia.repository.Panel = Ext.extend(Sonia.rest.Panel, {
scope: this
},
created: {
fn: this.reload,
fn: this.clearRepositoryFilter,
scope: this
}
}
}]);
},
clearRepositoryFilter: function(){
if (debug){
console.debug('clear repository filter');
}
Ext.getCmp('repositorySearch').setValue('');
Ext.getCmp('repositoryTypeFilter').setValue('');
var grid = Ext.getCmp('repositoryGrid');
grid.clearStoreFilter();
grid.reload();
},
reload: function(){
Ext.getCmp('repositoryGrid').reload();