PDA

View Full Version : [FIXED] Duplicate state events added



oklymenko
16 Nov 2011, 12:37 PM
In my grid state management code, I have to call initStateEvents multiple times. The problem is that this method does not check the return from Array.indexOf correctly and, as a result, all of the event names but the first one (columnresize) are added to this.stateEvents array again. It should check for -1.



initStateEvents: function(){
var events = this.stateEvents;
// push on stateEvents if they don't exist
Ext.each(['columnresize', 'columnmove', 'columnhide', 'columnshow', 'sortchange'], function(event){
if (Ext.Array.indexOf(events, event)) {
events.push(event);
}
});
this.callParent();
},

This problem is in Ext.window.Window and Ext.panel.Table.

Thanks,
Alex.

mitchellsimoens
19 Nov 2011, 2:36 PM
Thank you for the report.