Wijmo 5 | Select Multiple Rows using checkbox

Select rows without using boolean property from itemsSource

HTML

<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.min.js"></script>
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.input.min.js"></script>
<script src="http://cdn.wijmo.com/5.latest/controls/wijmo.grid.min.js"></script>
<link rel="stylesheet" href="http://cdn.wijmo.com/5.latest/styles/wijmo.min.css">
<div id= "theGrid"></div>
<button id="getCheckedRows">
Get SelectedRows
</button>
<div id="rows">
SelectedRows: 
</div>

CSS

#theGrid{
	max-height:500px;
}

JavaScript

onload=function(){
   //create random data
	var getData = function (value) {
            var countries = 'India,Japan,UK,US,China'.split(','),
           data = [];
            for (var i = 0; i < value; i++) {
                data.push({
                    id: i + 1,
                    country: countries[i % countries.length],
                    sales: Math.random() * 10000,
                    downloads: Math.random() * 200,
                    active: i%3==0
                });
            }
			return data;
	};
	var cvData=new wijmo.collections.CollectionView(getData(5));
	var grid= new wijmo.grid.FlexGrid("#theGrid",{
		itemsSource:cvData,
    selectionMode: "ListBox"
	});
	// add column for adding checkbox  to select rows
	grid.columns.push(new wijmo.grid.Column({align:'center',name:"select"}));
	// add checkbox  in FlexGrid column's cell
	grid.itemFormatter=function(panel,r,c,cell){
		if(panel.columns[c].name=='select' && (panel.cellType==1 || panel.cellType==2)){
		cell.innerHTML='<input type="checkbox" />';
		}
	}
  
  grid.rows[3].isSelected =true;
  grid.rows[0].isSelected =true;
  grid.rows[4].isSelected =true;
  
	
	// get selected rows in the FlexGrid
	document.getElementById("getCheckedRows").onclick=getCheckedRows;
	function getCheckedRows(){			
	var rowDiv=document.getElementById("rows");
  
	rowDiv.innetText+='[';
		for(var i=0;i<grid.rows.length;i++){
			if(grid.rows[i].isSelected){
      console.log(i,"T")
				rowDiv.innerText+=" "+i;
			}
		}
		rowDiv.innetText+=']';
	}
}