<script type="text/javascript">
$(function(){	

window.parent.$('#content_title').panel('setTitle', '<?=$this->title?>');	

setdg();
	
// $('#group_id').combobox({ 
// 	mode:'remote', 
// 	url:'<?=site_url('general/gridGroupId'); ?>',  
// 	valueField:'code_group_user',  
// 	textField:'name_group_user'  
// });

$('#group_id').combogrid({ 
	panelWidth:500,  	
	url: '<?=site_url('general/gridGroupId'); ?>',  
	idField:'code_group_user',  
	textField:'name_group_user',  
	mode:'remote',  
	rownumbers:true,
	fitColumns:true,
	pagination:true,
	columns:[[  
		{field:'code_group_user',title:'Group ID',width:30},
		{field:'name_group_user',title:'Group Name',width:100}
	]],  
	onClickRow:function(index,row){
		var pro = row.code_group_user;
		console.log(pro);
		if(pro == 'SUP'|| pro=='BC'){
			document.getElementById('pro').disabled = true;
			document.getElementById('dept').disabled = true;
			alert('masuk');
		}else{
			document.getElementById('dept').disabled = false;
			document.getElementById('pro').disabled = false;
		}
		}
});


$('#dept').combobox({ 
	mode:'remote', 
	url:'<?=site_url('general/gridDept1'); ?>',  
	valueField:'dept_cd',  
	textField:'dept_name'  
});



$('#pro').combobox({ 
	mode:'remote', 
	url:'<?=site_url('general/gridpro'); ?>',  
	valueField:'project_cd',  
	textField:'project_name'  
});

$('#company').combogrid({ 
	panelWidth:500,  	
	url: '<?=site_url('general/gridPrshn'); ?>',  
	idField:'KdPrshn',  
	textField:'NmPrshn',  
	mode:'remote',  
	rownumbers:true,
	fitColumns:true,
	pagination:true,
	columns:[[  
		{field:'KdPrshn',title:'Company ID',width:30},
		{field:'NmPrshn',title:'Company Name',width:100}
	]],  
});


$('#btnTbh').click(function(){
	tambah();
});

$('#btnUbh').click(function(){	
	ubah();
});

$('#btnHps').click(function(){
	hapus();
});


$('#btnPrint').click(function(){
	aksi('print');
});

$('#btnDb').click(function(){
	backupDatabaseTables();
});

$('#btnExcel').click(function(){
	aksi('xls');
});

$('#btnSubmit').click(function(){
	backupDatabaseTables();
});

$('#btnReset').click(function(){
	$('#fm').form('clear');
});

$('#q').searchbox({
	width:200,
	searcher:function(value,name){  
		///alert(value + "," + name)  
		cari(value);
	},
	prompt:'Cari Username & Nama Karyawan'  
});  


});//Akhir Document Ready
</script>