﻿/*
 * Ext JS Library 2.0
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 *
 * http://extjs.com/license
 */
Ext.onReady(function(){
    Ext.QuickTips.init();
    
    // simple array store
    var store_bairros = new Ext.data.SimpleStore({
        fields: ['rj', 'bairros', 'zona'],
        data: Ext.combos.bairros // pega de selects_value.php
    });
    
    //var cod_imoveis = new Ext.form.
    
    var combo_bairros = new Ext.form.TextField({
        selectOnFocus: true,
        emptyText: 'Código...',
        maxHeight: 150,
        width: 140,
        applyTo: 'cod_imovel'
    });
    
    var combo_bairros = new Ext.form.ComboBox({
        tpl: '<tpl for="."><div ext:qtip="{bairros} - {zona}" class="x-combo-list-item">{bairros}</div></tpl>',
        store: store_bairros,
        displayField: 'bairros',
        typeAhead: true,
        mode: 'local',
        triggerAction: 'all',
        emptyText: 'Bairro...',
        selectOnFocus: true,
        maxHeight: 150,
        width: 140,
        applyTo: 'bairros'
    });
    
    var store_tipo = new Ext.data.SimpleStore({
        fields: ['tipo'],
        data: Ext.combos.tipo // pega de selects_value.php
    });
    
    var combo_tipo = new Ext.form.ComboBox({
        store: store_tipo,
        displayField: 'tipo',
        typeAhead: true,
        mode: 'local',
        triggerAction: 'all',
        emptyText: 'Tipo...',
        selectOnFocus: true,
        width: 140,
        applyTo: 'tipo'
    });
	
	var store_opcao = new Ext.data.SimpleStore({
        fields: ['opcao'],
        data: Ext.combos.opcao // pega de selects_value.php
    });
    
    var combo_opcao = new Ext.form.ComboBox({
        store: store_opcao,
        displayField: 'opcao',
        typeAhead: true,
        mode: 'local',
        triggerAction: 'all',
        emptyText: 'Opção...',
        selectOnFocus: true,
        width: 140,
        applyTo: 'opcao'
    });
    
    var store_valor = new Ext.data.SimpleStore({
        fields: ['valor'],
        data: Ext.combos.valor // pega de selects_value.php
    });
    
    var combo_valor = new Ext.form.ComboBox({
        store: store_valor,
        displayField: 'valor',
        typeAhead: true,
        mode: 'local',
        triggerAction: 'all',
        emptyText: 'Valor...',
        selectOnFocus: true,
        width: 140,
        applyTo: 'valor'
    });
});
