var compainonsGrid_<?php echo $id;?> = new Ext.grid.EditorGridPanel({
	flex: 1,
	store: new Ext.data.Store({
		url: '<?php echo $ajax;?>',			
		baseParams:{
			action: 'getCompanions',
			userId: '<?php echo $id;?>'
		},
		autoLoad: true,
		reader: new Ext.data.JsonReader({		
			root:'rows',
			totalProperty : 'results'
		},
		new Ext.data.Record.create([
		 	{ name:"id", type: 'int' },
		 	{ name:"name", type:'string'},
		 	{ name:"presentation", type:'string'}
			])
		)
	}),
	sm: new Ext.grid.RowSelectionModel(),
    id: 'compainonsGrid_<?php echo $id;?>',
    border: false,
    title: '<?php echo $LangPack->GetLabel("kartoteka_person_form", "companions_tab_title","Spremstvo");?>',
    closable: false,
    columns:[{
    	header:'#ID',
    	dataIndex: 'id',
    	hidden: true
    },{
    	header: '<?php echo $LangPack->GetLabel("kartoteka_person_form", "name_column_title","Ime");?>',
    	dataIndex: 'name',
    	width: 120
    },{
    	header: '<?php echo $LangPack->GetLabel("kartoteka_person_form", "presentation_column_title","Presentacija");?>',
    	dataIndex: 'presentation',
    	width: 350
    }],
    listeners: {
    	'rowdblclick': function(grid, index, rec){
    		var row = grid.getStore().getAt(index);
            var id = row.data.id;
    		CallScript('<?php echo CRM_RPATH; ?>_forms/kartoteka/forms.main.panel.php', { id: id });
    	}
    }
});
