
<div id="container_pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list" style="height:100%; margin:0px; padding:0px;overflow:'hidden'; border: 0px solid #cd0a0a">
	<div class="pane-header ui-state-active" id="pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list_bar" >
	LIST DOCUMENT
</div>
<table id="pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list"></table> <div id="ppasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list"></div>
</div> 

<script type="text/javascript">
 	
    $(document).ready(function(){ 
	
	
		var ceisa_bc_out<?php echo $bc_prefix;  ?>_cust_code='<?php echo $cust_code;  ?>';
		$(window).bind('resize', function() {  
			setTimeout(function(){
	 			setGridHight($("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list"),$("#container_pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list"),$("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list_bar")); 
			},10); 
		});  
	  
 
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list").jqGrid({
			url:'<?php echo base_url().'pasi_ceisa_bc_out/ct_pasi_ceisa_bc_out_from_sa/loaddata_dokumen'; ?>',
			datatype: "json",
			mtype : "post",
			postData:{	id_header:'<?php echo $id_header;  ?>'  
						},
						colNames:[
'tpb_out_dokumen_ID','tpb_out_dokumen_ID_ORI','SERI','CODE','NAME','NO'
,'DATE','Date','By','Date','By'
,'tpb_out_dokumen_FLAG_URL_DOKUMEN','tpb_out_dokumen_URL_DOKUMEN','tpb_out_dokumen_TIPE_DOKUMEN','tpb_out_dokumen_ID_HEADER','tpb_out_dokumen_ID_HEADER_ORI'

]
,colModel:[
{name:'rID',index:'rID', width:80, hidden:true, align :'right'}
,{name:'r1',index:'r1', width:80, hidden:true, align :'right'}
,{name:'r2',index:'r2', width:60, hidden:false, align :'center'}
,{name:'r3',index:'r3', width:60, hidden:false, align :'left'}
,{name:'r4',index:'r4', width:150, hidden:false, align :'left'}
,{name:'r5',index:'r5', width:200, hidden:false, align :'left'}

,{name:'r6',index:'r6', width:80, hidden:false, align :'left', searchoptions:{searchhidden: true,dataInit:function(el){$(el).datepicker({onSelect: function(date){jQuery("#table_name")[0].triggerToolbar();},changeMonth: true,changeYear: true,dateFormat:'dd/mm/yy', showButtonPanel: true, beforeShow: function(input) {  setTimeout(function() { var buttonPane = $(input).datepicker("widget").find( ".ui-datepicker-buttonpane" );   var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>');   btn.unbind("click").bind("click", function () {   $.datepicker._clearDate( input );   });   btn.appendTo( buttonPane );  }, 1 );  }  });}}}
,{name:'r7',index:'r7', width:100, hidden:false, align :'left', searchoptions:{searchhidden: true,dataInit:function(el){$(el).datepicker({onSelect: function(date){jQuery("#table_name")[0].triggerToolbar();},changeMonth: true,changeYear: true,dateFormat:'dd/mm/yy', showButtonPanel: true, beforeShow: function(input) {  setTimeout(function() { var buttonPane = $(input).datepicker("widget").find( ".ui-datepicker-buttonpane" );   var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>');   btn.unbind("click").bind("click", function () {   $.datepicker._clearDate( input );   });   btn.appendTo( buttonPane );  }, 1 );  }  });}}}
,{name:'r8',index:'r8', width:80, hidden:false, align :'left'}
,{name:'r9',index:'r9', width:100, hidden:false, align :'left', searchoptions:{searchhidden: true,dataInit:function(el){$(el).datepicker({onSelect: function(date){jQuery("#table_name")[0].triggerToolbar();},changeMonth: true,changeYear: true,dateFormat:'dd/mm/yy', showButtonPanel: true, beforeShow: function(input) {  setTimeout(function() { var buttonPane = $(input).datepicker("widget").find( ".ui-datepicker-buttonpane" );   var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">Clear</button>');   btn.unbind("click").bind("click", function () {   $.datepicker._clearDate( input );   });   btn.appendTo( buttonPane );  }, 1 );  }  });}}}
,{name:'r10',index:'r10', width:80, hidden:false, align :'left'}

,{name:'r11',index:'r11', width:80, hidden:true, align :'right'}
,{name:'r12',index:'r12', width:80, hidden:true, align :'right'}
,{name:'r13',index:'r13', width:80, hidden:true, align :'right'}
,{name:'r14',index:'r14', width:80, hidden:true, align :'right'}
,{name:'r15',index:'r15', width:80, hidden:true, align :'right'}


],
		//	rowNum:-1,
		//	multiselect: true, 
			rowNum:100,
		 	rowList:[10,20,30,50,100,200],
	 		pager: '#ppasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list',
			sortname: 'r2',
			viewrecords: true,
			sortorder: "desc",
			width: '',
			height: 100,
			//width: 950,
			//height:300,
			jsonReader: { repeatitems : false }, 
			rownumbers: true,
			loadonce: false,
			shrinkToFit: false, 
			afterInsertRow: function(rowid, aData){
				/*switch (aData.statusdok) {
					case 'DATA SENT':
						jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list").jqGrid('setCell',rowid,'statusdok','',{color:'green'});
					break;
					case '2':
						jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list").jqGrid('setCell',rowid,'statusdok','',{color:'red'});
					break;
					case '1':
						jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list").jqGrid('setCell',rowid,'statusdok','',{color:'blue'});
					break;
					
				} */
			},
			gridComplete: function(){
				var rowIDs = jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list").getDataIDs(); 
				var rowData = $("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list").getRowData();
			
				for (var i = 0; i < rowData.length; i++) 
				{
				   var trElement = jQuery("#"+ rowIDs[i],jQuery('#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list'));
				   
					switch (rowData[i].status_2) {
						case 'DATA PROCESSED':
						   trElement.css({"color":"green"});
						break;
						
						case 'SENT TO INVENTORY CANCELED':
						   trElement.css({"color":"green"});
						break;
						
						case 'DATA SENT TO INVENTORY':
						   trElement.css({"color":"purple"});
						break;
						case 'DATA PROCESSED INVENTORY':
						   trElement.css({"color":"blue"});
						break;
						case 'APPROVED INVENTORY':
						   trElement.css({"color":"red"});
						break;
					}
				}
			}, 
		}); 
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list").jqGrid('setGroupHeaders', 
            { useColSpanStyle: true, groupHeaders:[
			{startColumnName: 'r3', numberOfColumns: 2, titleText: '<em><center>TYPE</center></em>'},
			{startColumnName: 'r5', numberOfColumns: 2, titleText: '<em><center>DOCUMENT</center></em>'},  
    		{startColumnName: 'r7', numberOfColumns: 2, titleText: '<em><center>CREATE</center></em>'},  
    		{startColumnName: 'r9', numberOfColumns: 4, titleText: '<em><center>MODIFY</center></em>'},  
        ] });       
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list").jqGrid('navGrid','#ppasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : true, defaultSearch: 'cn', ignoreCase: true});
		 
	
	setTimeout(function(){
	 		setGridHight($("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list"),$("#container_pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list"),$("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_dokumen_list_bar")); 
	},100); 
	});
		  	
</script>

	
	