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

$('#dtdari').datebox({ 
	onSelect:function(date){setdgCari()} 
})

$('#dtsampai').datebox({ 
	onSelect:function(date){setdgCari()} 
})

$('#KdBarang').combogrid({  
	panelWidth:500,  	
	url: '<?=site_url('bahanbaku/grid')?>',  
	idField:'kd_barang',  
	textField:'nm_barang',  
	mode:'remote',  
	rownumbers:true,
	fitColumns:true,
	pagination:true,
	columns:[[  
		{field:'kd_barang',title:'Item Code',width:60},
		{field:'nm_barang',title:'Item Description',width:150},		
		{field:'warna',title:'Color',width:100},		
		{field:'kd_uom',title:'UOM',width:50}
	]]
});

$('#prodcard_id').combobox({	
	width:100,
	mode:'remote', 
	url: '<?=site_url('prod_card/gridAll')?>',  
	valueField:'prodcard_id',  
	textField:'prodcard_no',
	fitColumns: true
});

$('#lot_no').textbox({
	width:100
});


setdg();
$('#w').window({ 
	width:'99%',
	title:"<?php echo strtoupper($title) ?>", 
	top:10,
	left:10,
	collapsible:false,	
	minimizable:false,
	maximizable:false,
	closable:true,
	inline:true,
	onClose:function(){		
		var tab = window.parent.$('#tt').tabs('getSelected');
		var index = window.parent.$('#tt').tabs('getTabIndex',tab);
		window.parent.$('#tt').tabs('close', index);
	}
});  

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

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

$('#btnCari').click(function(){
	setdgCari();
});


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