   		//dburl：双击链接
	    //options:

	    var SearchBase=function(nameurl,options){
			
   			options = options || {};
	    	Ext.apply(this,options);		    
		    this.store = new Ext.data.JsonStore({
			    url: nameurl,
			    root: 'topics',
			    totalProperty: 'totalCount',
			    idProperty: 'supplierid',
			    fields: ['supplierid', 'partyid','suppliername','num']
			}),
	    	this.search = new Ext.app.SearchField({
		        store: this.store,
		        width:320
			}),
			this.grid = new Ext.grid.GridPanel({
		        store: this.store,
		        columns: [
		            {id:'name',header: "供应商名称", width: 160, sortable: true, dataIndex: 'suppliername'}
		        ],
		        stripeRows: true,
		        autoExpandColumn: 'name',
		        loadMask: true,
		        tbar: [
		            'Search: ', ' ',this.search
		        ]
			})
		    

		    this.windowL = new Ext.Window({
		        title: '查询',
		        width: 400,
		        height:250,
				resizable:false,
		        layout: 'fit',
		        plain:true,
		        //bodyStyle:'padding:1px;',
		        buttonAlign:'center',
		        items: this.grid,
				closable:false,
		        buttons: [/*{
		            text: '确定',
		            handler: function(target){ 						
						target.ownerCt.hide();
		            }            
		        },*/
		        {
		            text: '关闭',
		            handler: function(target){ 
						target.ownerCt.hide();
				    }  	            
		        }]
		    });  
		  	//初始化窗口;		    
			this.initWin();
		    this.store.setDefaultSort('supplierid');

	    };
SearchWindow=Ext.extend(SearchBase, {
    	nowRow:-1,		
	   	initWin:function(){	
	    	this.grid.on('rowclick',function( e, rowIndex, event ){		    		
				this.nowRow=rowIndex; 
			})
	    },
	    show:function(keywords,autoSearch){
	    	//autoSeach:boolean 是否开启对话框后自动搜索
			this.search.value=keywords;
		    this.windowL.show(); 
		    if(autoSearch==true){
		    	this.search.onTrigger2Click();
		    }
	    }
   })