Ext.QuickTips.init();
var combobox_list = new Ext.util.MixedCollection();
function combobox_add(cfg) {
    var elem = document.getElementById(cfg.applyTo);
    if (!elem) return;
    var id = elem.id;
    elem.id += "_ext_yt";
    var cb = new Ext.form.ComboBox({
        applyTo: elem.id,
        displayField: 'Data',
        editable: false,
        hiddenId: cfg.applyTo,
        hiddenName: cfg.applyTo.replace(/_/g,'.'),
        listeners: cfg.onselect ? { 'select': cfg.onselect } : null,
        mode: 'local',
        selectOnFocus: true,
        store: (cfg.store ? cfg.store : new Ext.data.SimpleStore({ fields: ['Value', 'Data'], data: cfg.data })),
        tpl: '<tpl for="."><div ext:qtip="{Data}" class="x-combo-list-item">{Data}</div></tpl>',
        triggerAction: 'all',
        typeAhead: true,
        value: (cfg.defaultValue ? cfg.defaultValue : ''),
        valueField: 'Value'
    });
    combobox_list.add(id, cb);
}
