mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-05 20:00:55 +01:00
clear filter after repository creation, see #48
This commit is contained in:
@@ -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 ){
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user