Skip to content

Commit

Permalink
FIX BUG wnielson#56
Browse files Browse the repository at this point in the history
Adding the possibility that the items are empty at initialization
  • Loading branch information
maarekj committed Jul 11, 2013
1 parent 74a12db commit bd75fbb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ux/slidenavigation/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,15 @@ Ext.define('Ext.ux.slidenavigation.View', {

var selectedItemIndex = 0;

Ext.each(this.list.getStore().getRange(), function(item, index) {
if (item.get('selected') === true) {
selectedItemIndex = index;
}
});
if (this.list.getStore().getCount() > 0) {
Ext.each(this.list.getStore().getRange(), function(item, index) {
if (item.get('selected') === true) {
selectedItemIndex = index;
}
});

this.list.select(selectedItemIndex);
this.list.select(selectedItemIndex);
}

this.__init = true;

Expand Down

0 comments on commit bd75fbb

Please sign in to comment.