Dojox DataGrid: achieve row selection only by Checkboxes
http://stackoverflow.com/questions/10914157/dojox-datagrid-achieve-row-selection-only-by-checkboxes
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojox/grid/resources/claroGrid.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojox/grid/resources/Grid.css">
<button onclick="showSelect()">
Show
</button>
<div id="gridDiv"></div>
CSS
#grid {
width: 43em;
height: 20em;
}
JavaScript
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileWriteStore");
dojo.require("dojox.grid._CheckBoxSelector");
dojo.require("dojo.store.Memory");
dojo.require("dojo.data.ObjectStore");
dojo.ready(function(){
var fruit = ['apple', 'orange', 'banana'];
fruit.splice(0,1);
alert(fruit);
// Create statistic data grid
var data = {
identifier: 'id',
items: []
};
for (var i=0; i<10; i++){
var tmp_data = {
'principalNo': 1,
'principalName': 2,
'systemCriteria': 3,
'userCriteria': 4,
'selected': 5,
'pendingCheck': 6,
'checked': 7,
'furtherReview': 8,
'notSelected': 9,
'total': 10
};
data.items.push(tmp_data);
}
var objectStore = new dojo.store.Memory({data:data});
var sampleStore = new dojo.data.ObjectStore({objectStore: objectStore});
var cellslayout = [[
{'name': 'Ref No', 'field': 'principalNo', 'width': '5%'},
{'name': 'Principal Name', 'field': 'principalName', 'width': '20%'},
{'name': 'System Criteria', 'field': 'systemCriteria', 'width': '5%'},
{'name': 'User Criteria', 'field': 'userCriteria' , 'width': '10%'},
{'name': 'Selected', 'field': 'selected', 'width': '5%'},
{'name': 'Pending Check', 'field': 'pendingCheck', 'width': '10%'},
{'name': 'Checked', 'field': 'checked', 'width': '5%'},
{'name': 'Further Review', 'field': 'furtherReview', 'width': '10%'},
{'name': 'Not selected', 'field': 'notSelected', 'width': '10%'},
{'name': 'Total', 'field': 'total', 'width': '10%'}
]];
var gridLayout = [
cellslayout
];
this.sampleStatisticGrid = new dojox.grid.DataGrid({
id: 'statisticGrid',
store:...