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

<script type="text/javascript">
 	var i_number = 3500.5; 
	var globaldecimalSeparator=i_number.toLocaleString().substr(1, 1);
	var globalthousandsSeparator=i_number.toLocaleString().substr(6, 1);
	
    $(document).ready(function(){ 
	  
 	   
	function YNFormatter(cellvalue, options, rowObject)
	{
		return '<span class="cellWithoutBackground" style="background-color:' +
       color + ';">' + cellvalue + '</span>';
    }
	
		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_item_compare"),$("#container_pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare"),$("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare_bar")); 
			},10); 
		});  
	  
 
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare").jqGrid({
			url:'<?php echo base_url().'pasi_ceisa_bc_out/ct_pasi_ceisa_bc_out_from_sa/loaddata_item_compare_ceisa'; ?>',
			datatype: "json",
			mtype : "post",
			postData:{	id_header:'<?php echo $id_header;  ?>'  }
			, colNames:[
				'vw_fn_t_sa_item_compare_ceisa_ID'
				, 'VALID'
				,'SA'
				,'CEISA'
				
				,'SA'
				,'SA ON BC'
				,'CEISA'
				
	 			,'INFO'
				
				,'SA'
				,'CEISA'
				
				,'SA'
				,'CEISA'
				
				,'SA'
				,'CEISA'
				
				,'SA'
				,'CEISA'
				,'vw_fn_t_sa_item_compare_ceisa_JUMLAH_SATUAN_VALID'
				
				,'SA'
				,'CEISA'
				
				,'SA'
				,'CEISA'
				
				,'SA'
				,'CEISA'
				,'vw_fn_t_sa_item_compare_ceisa_HARGA_PENYERAHAN_VALID'
				]
				,colModel:[
				{name:'rID',index:'rID', width:80, hidden:true, align :'right'}
				,{name:'r6',index:'r6', width:40, editable: false, formatter:'checkbox',  align: "center",stype: "select", searchoptions: { value: "-100:All;1:Yes;0:No" }}

				,{name:'r1',index:'r1', width:80, hidden:false, align :'left'}
				,{name:'r2',index:'r2', width:80, hidden:false, align :'left'}
				
				,{name:'r3',index:'r3', width:120, hidden:false, align :'left'}
				,{name:'r4',index:'r4', width:250, hidden:false, align :'left'}
				,{name:'r5',index:'r5', width:120, hidden:false, align :'left'}
				
				,{name:'r7',index:'r7', width:250, hidden:false, align :'left'}
				
				,{name:'r8',index:'r8', width:60, hidden:false, align :'left'}
				,{name:'r9',index:'r9', width:60, hidden:false, align :'left'}
				
				,{name:'r10',index:'r10', width:60, hidden:false, align :'left'} 
				,{name:'r11',index:'r11', width:60, hidden:false, align :'left'}
				
				,{name:'r12',index:'r12', width:80, hidden:false, align :'left'}
				,{name:'r13',index:'r13', width:80, hidden:false, align :'left'}
				
				,{name:'r14',index:'r14', width:80, hidden:false, align :'right', cellattr: function (rowId, val, rawObject, cm, rdata) {
																					   if (rawObject.r16 == 0) {
																						return " class='ui-state-error-text ui-state-error'";
																						} 
																					},formatter:'currency', formatoptions:{decimalSeparator:'<?php echo $decimalSeparator;  ?>', thousandsSeparator: '<?php echo $thousandsSeparator;  ?>', decimalPlaces: 2, prefix: ""} }
				,{name:'r15',index:'r15', width:80, hidden:false, align :'right', cellattr: function (rowId, val, rawObject, cm, rdata) {
																					   if (rawObject.r16 == 0) {
																						return " class='ui-state-error-text ui-state-error'";
																						} 
																					},formatter:'currency', formatoptions:{decimalSeparator:'<?php echo $decimalSeparator;  ?>', thousandsSeparator: '<?php echo $thousandsSeparator;  ?>', decimalPlaces: 2, prefix: ""} } 
				,{name:'r16',index:'r16', width:80, hidden:true, align :'right'}
				
				,{name:'r17',index:'r17', width:80, hidden:false, align :'left'}
				,{name:'r18',index:'r18', width:80, hidden:false, align :'left'} 
  
				,{name:'r19',index:'r19', width:80, hidden:false, align :'right',formatter:'currency', formatoptions:{decimalSeparator:'<?php echo $decimalSeparator;  ?>', thousandsSeparator: '<?php echo $thousandsSeparator;  ?>', decimalPlaces: 2, prefix: ""} }
				,{name:'r20',index:'r20', width:80, hidden:false, align :'right',formatter:'currency', formatoptions:{decimalSeparator:'<?php echo $decimalSeparator;  ?>', thousandsSeparator: '<?php echo $thousandsSeparator;  ?>', decimalPlaces: 2, prefix: ""} }

				,{name:'r21',index:'r21', width:150, hidden:false, align :'right', cellattr: function (rowId, val, rawObject, cm, rdata) {
																					   if (rawObject.r23 == 0) {
																						return " class='ui-state-error-text ui-state-error'";
																						} 
																					},formatter:'currency', formatoptions:{decimalSeparator:'<?php echo $decimalSeparator;  ?>' , thousandsSeparator: '<?php echo $thousandsSeparator;  ?>', decimalPlaces: 2, prefix: ""} }
				,{name:'r22',index:'r22', width:150, hidden:false, align :'right', cellattr: function (rowId, val, rawObject, cm, rdata) {
																					   if (rawObject.r23 == 0) {
																						return " class='ui-state-error-text ui-state-error'";
																						} 
																					},formatter:'currency', formatoptions:{decimalSeparator:'<?php echo $decimalSeparator;  ?>', thousandsSeparator: '<?php echo $thousandsSeparator;  ?>', decimalPlaces: 2, prefix: ""} }
				,{name:'r23',index:'r23', width:80, hidden:true, align :'right'}

				],
		//	rowNum:-1,
		//	multiselect: true, 
			rowNum:200,
		 	rowList:[10,20,30,50,100,200,500,1000],
	 		pager: '#ppasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare',
			sortname: 'r4',
			viewrecords: true,
			sortorder: "asc",
			width: '',
			height: 100,
			//width: 950,
			//height:300,
			jsonReader: { repeatitems : false }, 
			rownumbers: true,
			loadonce: false,
			shrinkToFit: false, 
			// onSelectRow: function(rowid){ 
				// var rowData = $("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare").getRowData(rowid); 
		 		// if (rowData.rg == 'Yes' && '<?php echo $is_get;  ?>'=='1'){
					// $("#pasi_ceisa_bc_<?php echo $bc_prefix;  ?>_out_map_item_manual").show(); 
				// }
				// else{
					// $("#pasi_ceisa_bc_<?php echo $bc_prefix;  ?>_out_map_item_manual").hide(); 
			   // }
	 
  		 	 // },
			afterInsertRow: function(rowid, aData){
				/*switch (aData.statusdok) {
					case 'DATA SENT':
						jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare").jqGrid('setCell',rowid,'statusdok','',{color:'green'});
					break;
					case '2':
						jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare").jqGrid('setCell',rowid,'statusdok','',{color:'red'});
					break;
					case '1':
						jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare").jqGrid('setCell',rowid,'statusdok','',{color:'blue'});
					break;
					
				} */
			},
			gridComplete: function(){
				var rowIDs = jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare").getDataIDs(); 
				var rowData = $("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare").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_item_compare'));
				   
					switch (rowData[i].r6) { 
						case 'No':
						   trElement.css({"color":"red"});
						break;
					}
				}
			}, 
		}); 
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare").jqGrid('setGroupHeaders', 
            { useColSpanStyle: true, groupHeaders:[
			{startColumnName: 'r1', numberOfColumns: 2, titleText: '<em><center>ITEM CODE</center></em>'},
			{startColumnName: 'r3', numberOfColumns: 3, titleText: '<em><center>ITEM NAME</center></em>'},  
    	 	{startColumnName: 'r8', numberOfColumns: 2, titleText: '<em><center>TIPE</center></em>'},  
    	 	{startColumnName: 'r10', numberOfColumns: 2, titleText: '<em><center>SIZE</center></em>'},  
    	 	{startColumnName: 'r12', numberOfColumns: 2, titleText: '<em><center>MERK</center></em>'},  
     	    {startColumnName: 'r14', numberOfColumns: 2, titleText: '<em><center>QUANTITY</center></em>'},  
     	    {startColumnName: 'r17', numberOfColumns: 2, titleText: '<em><center>UOM</center></em>'},  
     	    {startColumnName: 'r19', numberOfColumns: 2, titleText: '<em><center>@PRICE</center></em>'},  
     	    {startColumnName: 'r21', numberOfColumns: 2, titleText: '<em><center>TOTAL</center></em>'},  
     	       ] });       
			   
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare").jqGrid('navGrid','#ppasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : true, defaultSearch: 'cn', ignoreCase: true});
		 
	
	setTimeout(function(){
	 		setGridHight($("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare"),$("#container_pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare"),$("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_item_compare_bar")); 
	},100); 
	});
		  	
</script>

	
	