/*!
 * Ext JS Library 3.0.0
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.onReady(function(){

    var ds = new Ext.data.Store({
        proxy: new Ext.data.ScriptTagProxy({
            url: 'completer.php'
        }),
        reader: new Ext.data.JsonReader({
            root: 'topics',
            totalProperty: 'totalCount'
        }, [
            {name: 'title', mapping: 'title'}
        ])
    });
    
    var desc = new Ext.form.ComboBox({
        store: ds,
        displayField:'title',
        typeAhead: false,
       // width: 570,
       // pageSize:10,
        hideTrigger:true,
        applyTo: 'desc',
        minChars: 1,
        //y:'auto',
//        onSelect: function(record){ // override default onSelect to do redirect
//        	loadfile();
//        	return false;
//            //window.location =
//                //String.format('http://extjs.com/forum/showthread.php?t={0}&p={1}', record.data.topicId, record.id);
//        }
         // all of your config options
	    listeners:{
	    	 scope:this,
	         'select': loadGrid
	    }

    });
    
    document.getElementById('desc').style.top = 'auto';
});