var <?php echo $gridName;?> = new Ext.grid.EditorGridPanel({
	store: loggerStore,
	sm: new Ext.grid.RowSelectionModel(),
    id: '<?php echo $gridName;?>',
    border: false,
    listeners:{
    	celldblclick: function(grid, rowIndex, cellIndex, e){
    		var record = grid.getStore().getAt(rowIndex);
    		var field = record.fields.items[cellIndex];
    		CallScript('CRM/_forms/logger/window.viewValue.php', { field: field.name, rowIndex: rowIndex });
    	}
    },
    columns:[{
    	header: "#ID",
    	dataIndex: 'id',
    	hidden: true
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "added_column_title","Dodano");?>',
    	dataIndex: 'Added'
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "oldvalue_column_title","Stara vrednost");?>',
    	dataIndex: 'OldValue'
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "newvalue_column_title","Nova vrednost");?>',
    	dataIndex: 'NewValue'
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "area_column_title","Območje");?>',
    	dataIndex: 'area'
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "changetype_column_title","Način spremembe");?>',	
    	dataIndex: 'ChangeType'
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "editedfield_column_title","Spremenjeno polje");?>',
    	dataIndex: 'EditedField'
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "editedtable_column_title","Spremenjena tabela");?>',
    	dataIndex: 'EditedTable'
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "userId_column_title","Uporabnik");?>',
    	dataIndex: 'UserId'
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "filenae_column_title","Spremenjena datoteka");?>',
    	dataIndex: 'fileName'
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "post_column_title","POST");?>',
    	dataIndex: 'POST'
    },{
    	header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "get_column_title","GET");?>',
    	dataIndex: 'GET'
    },{
        header: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "session_column_title","SESSION");?>',
        dataIndex: 'SESSION'
    }],
    bbar: new Ext.PagingToolbar({
        pageSize: loggerPageLimit,
        store: loggerStore,
        displayInfo: true,
        listeners:{
        	beforechange: function(pagger){
        		Ext.getCmp('<?php echo $gridName;?>').getStore().setBaseParam('action','get');
        		Ext.getCmp('<?php echo $gridName;?>').getStore().setBaseParam('dateFrom', Ext.getCmp('dateFrom').getRawValue());
    			Ext.getCmp('<?php echo $gridName;?>').getStore().setBaseParam('dateTo', Ext.getCmp('dateTo').getRawValue());
    			Ext.getCmp('<?php echo $gridName;?>').getStore().setBaseParam('userId', Ext.getCmp('UserId').getValue());
    			Ext.getCmp('<?php echo $gridName;?>').getStore().setBaseParam('ChangeType', Ext.getCmp('ChangeType').getValue());
        	}
        },
        displayMsg: '<?php echo $LangPack->GetLabel("CRM_logger_panel", "pagger_display_msg","Loggov");?> {0} - {1} of {2}',
        emptyMsg: "<?php echo $LangPack->GetLabel("CRM_logger_panel", "pagger_empty_msg","Ni loga");?>"
    })
});
<?php echo $gridName;?>.getStore().reload();
