keep same repository group id after logout and re login

This commit is contained in:
Sebastian Sdorra
2012-10-23 08:27:46 +02:00
parent 1b4e1c8b5e
commit efd2f36b51
2 changed files with 15 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ Ext.grid.GroupingView.prototype.toggleGroupExt = Ext.grid.GroupingView.prototype
Ext.override(Ext.grid.GroupingView,{ Ext.override(Ext.grid.GroupingView,{
storedState: null, storedState: null,
idPrefix: '{grid.el.id}',
initTemplates : function(){ initTemplates : function(){
this.initTemplatesExt(); this.initTemplatesExt();
@@ -54,6 +55,19 @@ Ext.override(Ext.grid.GroupingView,{
applyState: function(state){ applyState: function(state){
this.storedState = state; this.storedState = state;
},
getPrefix: function(field){
var prefix;
if ( this.idPrefix == '{grid.id}' ){
prefix = this.grid.getId();
} else if (this.idPrefix == '{grid.el.id}') {
prefix = this.grid.getGridEl().id;
} else {
prefix = this.idPrefix;
}
prefix += '-gp-' + field + '-';
return prefix;
} }
}); });

View File

@@ -200,6 +200,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
} }
}, },
view: new Ext.grid.GroupingView({ view: new Ext.grid.GroupingView({
idPrefix: '{grid.id}',
enableGrouping: ! state.clientConfig.disableGroupingGrid, enableGrouping: ! state.clientConfig.disableGroupingGrid,
enableNoGroups: false, enableNoGroups: false,
forceFit: true, forceFit: true,