﻿/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
Ext.onReady(function () {

    Ext.QuickTips.init();

    var storeStations = new Ext.data.JsonStore({
        url: 'getStations.ashx'
        , fields: [
            { name: 'StationName', mapping: 'StationName' },
            { name: 'SCAC', mapping: 'SCAC' }
        ]
        , root: 'results'
    });

    var typeAheadCombo = new Ext.form.ComboBox({
        id: 'comboStation',
        fieldLabel: 'Stations',
        store: storeStations,
        valueField: 'StationName',
        displayField: 'SCAC',
        typeAhead: true,
        mode: 'remote',
        triggerAction: 'all',
        emptyText: 'Select a station...',
        selectOnFocus: true,
        width: 172,
        renderTo: 'searchvalue',
        minChars: 3,
        style: 'font-size:9.5px;',
        enableKeyEvents: true,
        listWidth: 190,
        resizable: true,
        listeners: {
            keypress: function (e,a) {
                checkEnter(a, SearchClick);
            }
        }
    });
});

