var <?php echo $filterName;?> = new Ext.form.FormPanel({
	id:'<?php echo $filterName;?>',
	bodyStyle:'padding: 20px',
	region: 'north',
	defaults:{
    	style: 'margin-right: 15px',
    	style: 'margin-bottom: 5px'
	},
    height: 65,
	collapsible: true,
	items:[{
		xtype:'container',
		layout: 'column',
		items:[new Ext.ux.form.LovCombo({
			title: '<?php echo $LangPack->GetLabel("statistic_filter_grid", "project_combo_select_label","Projekt");?>',
			width: 250,
			mode: 'remote',
			triggerAction: 'all',
			id: 'projectCombo',
			name: 'projectCombo',
			hiddenName: 'projectCombo',
			lazyRender: true,
			store: new Ext.data.Store({
				url: '<?php echo $ajax;?>',
				baseParams: {
					action: 'getProjects'
				},
				reader: new Ext.data.JsonReader({		
						root:'rows',
						totalProperty : "results"
					},
					new Ext.data.Record.create([
						{ name:"id", type: 'id'},
					 	{ name:"value", type: 'string' }
					])
				)
			}),
		    valueField: 'id',
		    displayField: 'value'
		}),{
			xtype: 'button',
			bodyStyle: 'margin-right: 25px',
	    	name: 'search',
	    	width: 60,
	    	text: '<?php echo $LangPack->GetLabel("CRM_all", "CRM_search_button","Iskanje");?>',
	    	handler: function(){
	    		var grid = Ext.getCmp('<?php echo $gridName;?>');
	    		if(Ext.getCmp('projectCombo').getValue() != ""){
	    			grid.getEl().mask('<?php echo $LangPack->GetLabel("CRM_all", "loading_mask_text","Posodabljanje...");?>');
		    		grid.getStore().reload({params: { project: Ext.getCmp('projectCombo').getValue()}, callback: function(resp, opt, success){
		    			if(success){
							grid.getEl().unmask();
						}
		    		}});
	    		}
	    	}
		}]
	}]
});