<div id="container_pasi_sto_rm_inv" style="height:100%; margin:0px; padding:0px;overflow:'hidden'; border: 0px solid #cd0a0a">
<table id="tbl_sto_rm"></table> <div id="ptbl_sto_rm"></div>
</div>
<script type="text/javascript">
    
    $(document).ready(function(){
		$(window).bind('resize', function() {  
			setTimeout(function(){
				setGridHight($("#tbl_sto_rm"),$("#container_pasi_sto_rm_inv")); 
			},10); 
		});


		jQuery("#tbl_sto_rm").jqGrid({
			url:'<?php echo base_url().'pasi_inventory/ct_stockopname_rm/loaddata'; ?>',
			mtype : "post",
			postData:{'q':'1'},
			datatype: "json",
			colNames:['id', 'Code','Name','Unit','Qty','Date STO','Date','By','Date','By'],
			colModel:[
	
			{name:'id_stock_opname_bb',index:'id_stock_opname_bb', width:60, hidden:true},
			{name:'kode_barang',index:'kode_barang', width:100,align:'center', hidden:false},
			{name:'nama_barang',index:'nama_barang', width:300,align:'left', hidden:false},
			{name:'satuan_barang',index:'satuan_barang', width:100,align:'center', hidden:false},
			{name:'qty',index:'qty', width:100,align:'right',hidden:false},
			{name:'tgl_sto',index:'tgl_sto', width:80,align:'center',hidden:false},
			{name:'create_date',index:'create_date',align:'center',hidden:false},
			{name:'create_by',index:'create_by', width:100,align:'center',hidden:false},
			{name:'update_date',index:'update_date', width:100,hidden:false},
			{name:'update_by',index:'update_by', width:100,hidden:false},
			
				],
			rowNum:10,
			rowList:[10,20,30],
			pager: '#ptbl_sto_rm',
			sortname: 'id_stock_opname_bb',
			viewrecords: true,
			sortorder: "asc",
			width: '',
			height: 100,
			jsonReader: { repeatitems : false },
			caption:"Data Stock Opname Material and Helper",
			rownumbers: true,
			shrinkToFit: false,
			afterInsertRow: function(){
				
				
			},			
			gridComplete: function(){
				
			},
		}); 

		jQuery("#tbl_sto_rm").jqGrid('setGroupHeaders', 
            { useColSpanStyle: true, groupHeaders:[
			{startColumnName: 'kode_barang', numberOfColumns: 2, titleText: '<em><center>Item</center></em>'},
			{startColumnName: 'create_date', numberOfColumns: 2, titleText: '<em><center>Log Status</center></em>'},
			{startColumnName: 'update_date', numberOfColumns: 2, titleText: '<em><center>Log Modify</center></em>'}
			
        ] });
		
                        
		jQuery("#tbl_sto_rm").jqGrid('navGrid','#ptbl_sto_rm',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#tbl_sto_rm").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false, defaultSearch: 'cn', ignoreCase: true});
		
		setTimeout(function(){
			setGridHight($("#tbl_sto_rm"),$("#container_pasi_sto_rm_inv")); 
		},100); 
		

	});
		  	
</script>