src/aria/widgets/form/list/ListController.js
function () {
            var data = this._data;
            if (data.selectedIndex == -1) {
                // no item is selected
                return [];
            } else if (data.selectedIndex != null) {
                return [data.selectedIndex];
            } else {
                var retVal = [];
                // we iterate over the view, so that we return indexes in the order visible to the user:
                var view = data.itemsView;
                view.refresh(); // in case there are changes in the view, refresh it
                var items = view.items;
                for (var idx = 0, length = items.length; idx < length; idx++) {
                    if (items[idx].value.selected) {
                        // retVal.push(idx);
                        retVal.push(items[idx].initIndex);
                    }
                }
                return retVal;
            }
        }
function () {
            var data = this._data;
            if (data.selectedIndex == -1) {
                // no item is selected
                return [];
            } else if (data.selectedIndex != null) {
                return [data.selectedIndex];
            } else {
                var retVal = [];
                // we iterate over the view, so that we return indexes in the order visible to the user:
                var view = data.itemsView;
                view.refresh(); // in case there are changes in the view, refresh it
                var items = view.items;
                for (var idx = 0, length = items.length; idx < length; idx++) {
                    if (items[idx].value.selected) {
                        // retVal.push(idx);
                        retVal.push(items[idx].initIndex);
                    }
                }
                return retVal;
            }
        }
function ( ) { var data = this . _data ; if ( data . selectedIndex == - 1 ) { // no item is selected return [ ] ; } else if ( data . selectedIndex != null ) { return [ data . selectedIndex ] ; } else { var retVal = [ ] ; // we iterate over the view, so that we return indexes in the order visible to the user: var view = data . itemsView ; view . refresh ( ) ; // in case there are changes in the view, refresh it var items = view . items ; for ( var idx = 0 , length = items . length ; idx < length ; idx ++ ) { if ( items [ idx ] . value . selected ) { // retVal.push(idx); retVal . push ( items [ idx ] . initIndex ) ; } } return retVal ; } }
Get an array of all selected indexes.
@return {Array}
Get an array of all selected indexes .