
<div id="container_pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul" 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_sa_list_notul_bar" >
	LIST SA
</div>
<table id="pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul"></table> <div id="ppasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul"></div>
</div> 

<script type="text/javascript">
 	
    $(document).ready(function(){ 
	 
		$(window).bind('resize', function() {  
			setTimeout(function(){
	 			setGridHight($("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul"),$("#container_pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul"),$("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul_bar")); 
			},10); 
		});   
		
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul").jqGrid({
			url:'<?php echo base_url().'pasi_ceisa_master/ct_pasi_sa/loaddata'; ?>',
			datatype: "json",
			mtype : "post",
			postData:{	id_header:'<?php echo $id_header;  ?>' 
						,bc_prefix:'<?php echo $bc_prefix;  ?>'
						,mode :'2'
						},
	 		colNames:[
					'dt_sa_sa_id','SA','CUST CODE','Invoice\'S','Item\'S','dt_sa_file_data_id','rs'
			  		]
			,colModel:[
					{name:'rID',index:'rID', width:80, hidden:true, align :'right'}
					,{name:'r1',index:'r1', width:220, hidden:false, align :'right'}
					,{name:'r2',index:'r2', width:80, hidden:false, align :'right'}
					,{name:'r3',index:'r3', width:70, hidden:false, align :'right'}
					,{name:'r4',index:'r4', width:55, hidden:false, align :'right'}
					,{name:'r5',index:'r5', width:65, hidden:true, align :'right'}  
					,{name:'rs',index:'rs', width:65, 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_sa_list_notul',
			sortname: 'r1',
			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_sa_list_notul").jqGrid('setCell',rowid,'statusdok','',{color:'green'});
					break;
					case '2':
						jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul").jqGrid('setCell',rowid,'statusdok','',{color:'red'});
					break;
					case '1':
						jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul").jqGrid('setCell',rowid,'statusdok','',{color:'blue'});
					break;
					
				} */
			},
			gridComplete: function(){
				var rowIDs = jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul").getDataIDs(); 
				var rowData = $("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul").getRowData();
				var rowArray=[];
				
				 
				for (var i = 0; i < rowData.length; i++) 
				{
				 //   var trElement = jQuery("#"+ rowIDs[i],jQuery('#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul'));
				   if (rowData[i].rs=='1'){
					   //  rowArray.push(rowIDs[i]);  
					jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul").jqGrid('setSelection', rowIDs[i], true); 
				 } 
					// 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;
					// }
				}
				  // if (rowArray.length>0){ 
				 		// jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul").jqGrid('setSelection', rowArray, true); 
				  // }
			}, 
		}); 
 			               
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul").jqGrid('navGrid','#ppasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : true, defaultSearch: 'cn', ignoreCase: true});
		 
	
	setTimeout(function(){
	 		setGridHight($("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul"),$("#container_pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul"),$("#pasi_ceisa_bc_out<?php echo $bc_prefix;  ?>_sa_tbl_sa_list_notul_bar")); 
	},100); 
	});
		  	
</script>

	
	