dist/toolkit.js
function(index, event) {
        this.index = index;

        var rows = this.element.find('li');

        rows
            .removeClass('is-active')
            .find('a')
                .aria('selected', false);

        // Select
        if (index >= 0) {
            if (this.items[index]) {
                var item = this.items[index];

                rows.eq(index)
                    .addClass('is-active')
                    .find('a')
                        .aria('selected', true);

                this.input.val(item.title);

                this.fireEvent(event || 'select', [item, index]);
            }

        // Reset
        } else {
            this.input.val(this.term);

            this.fireEvent('reset');
        }
    }
function(index, event) {
        this.index = index;

        var rows = this.element.find('li');

        rows
            .removeClass('is-active')
            .find('a')
                .aria('selected', false);

        // Select
        if (index >= 0) {
            if (this.items[index]) {
                var item = this.items[index];

                rows.eq(index)
                    .addClass('is-active')
                    .find('a')
                        .aria('selected', true);

                this.input.val(item.title);

                this.fireEvent(event || 'select', [item, index]);
            }

        // Reset
        } else {
            this.input.val(this.term);

            this.fireEvent('reset');
        }
    }
function ( index , event ) { this . index = index ; var rows = this . element . find ( 'li' ) ; rows . removeClass ( 'is-active' ) . find ( 'a' ) . aria ( 'selected' , false ) ; // Select if ( index >= 0 ) { if ( this . items [ index ] ) { var item = this . items [ index ] ; rows . eq ( index ) . addClass ( 'is-active' ) . find ( 'a' ) . aria ( 'selected' , true ) ; this . input . val ( item . title ) ; this . fireEvent ( event || 'select' , [ item , index ] ) ; } // Reset } else { this . input . val ( this . term ) ; this . fireEvent ( 'reset' ) ; } }
Select an item in the list.

@param {Number} index
@param {String} [event]
Select an item in the list .