<?php
/**
 * Manually Developed CI View - appIntegrator_grid.php
 *
 * @package			AIR\views
 * @version			2.7
 * @uses
 * @see
 * @copyright		2015, BizyCorp Internal Systems Development
 * @license			private, All rights reserved
 * @author			Mohamed Roshan <roshan@ekwa.com>
 *
 */
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Manually Developed CI View
 *
 * This is the grid file of AIR listing.
 *
 * @package			AIR\views
 * @version			2.7
 * @uses
 * @see
 * @copyright		2015, BizyCorp Internal Systems Development
 * @license			private, All rights reserved
 * @author			Mohamed Roshan <roshan@ekwa.com>
 * @created			Jul 18, 2014
 * @modified
 * @modification
 *
*/
class dummy_cls{
	// Just a dummy clas for phpdoc to catch the doc header.
}

//Loads all JS and CSS files needed by the system (organized for optimum loading)
$this->load->view("js-css-loader.php");
?>


<div id="toolbarObj"></div>
<div id="divdataGrid" style="width:99.9%;height:99.9%;"></div>
<div id="recinfoArea"></div>

<script>
var wb;
var rowid;
var dataGrid;

function createdataGrid(dataGriddiv) {
    
    dataGrid = new dhtmlXGridObject(dataGriddiv);//CreatedataGrid(dataGrid);
    dataGrid.setImagePath('<?php echo base_url('public/img/common/imgs/'),'/';?>');
    dataGrid.setInitWidths("*,*,*,*,*,*");
    dataGrid.enableMultiline(true); 
       
    dataGrid.attachEvent("onRowSelect", function(id,ind){ 
        rowid = id;  
        if (debug) console.log('selected dataGrid row id in index page :-',id);
        //Following can be in a toggle function in the toolbarObj like
        // layoutBench.dataGridToolBar.toggleButtons('edit','deete')
       
        if(typeof wb !== 'undefinded'){
	  		wb.toolBarVar.enableItem('edit');
       		wb.toolBarVar.enableItem('delete');
		 }else if(typeof parent.wb !== 'undefined'){		 
       		parent.wb.toolBarVar.enableItem('edit');
       		parent.wb.toolBarVar.enableItem('delete');
	  	}	  	
    });


    dataGrid.attachEvent("onXLE",function() {wb.workBench.progressOff();});    
    dataGrid.attachEvent("onXLS", function() {	  
   	  if(typeof parent.wb !== 'undefined'){		 
      		parent.wb.toolBarVar.disableItem('edit');
      		parent.wb.toolBarVar.disableItem('delete');
  	  }
       
    });

    dataGrid.init();
    <?php if(ENVIRONMENT != 'localhost'){?>
    //dataGrid.enablePaging(true, 10, 3, "recinfoArea");
    //dataGrid.setPagingSkin("toolbar", "dhx_skyblue");
    <?php }?>
    dataGrid.setSkin("dhx_skyblue");   
    dataGrid.loadXML('<?php echo site_url()?>/AppIntegrator/index/false/0/0/ai_gridfeed/XML/');
   if(typeof parent.wb !== 'undefined'){	
    	parent.wb.grid = dataGrid;   //Edited by WCD
    	//Late binding as above cannot be done by setting the 'dataGrid' 
    	//property in the workbench as it is done at addSearch()
    	var mySearch = parent.wb.getSearch();
    	mySearch.grid = dataGrid;
   }else{
	    var mySearch = wb.getSearch();
   		mySearch.grid = dataGrid;
   }
    
}//end of creatdataGrid()
createdataGrid('divdataGrid');
</script>