97 lines
2.9 KiB
HTML
97 lines
2.9 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link rel="stylesheet" href="../slick.grid.css" type="text/css"/>
|
|
<link rel="stylesheet" href="../css/smoothness/jquery-ui-1.8.16.custom.css" type="text/css"/>
|
|
<link rel="stylesheet" href="examples.css" type="text/css"/>
|
|
<link rel="stylesheet" href="../controls/slick.columnpicker.css" type="text/css"/>
|
|
<style>
|
|
.slick-cell-checkboxsel {
|
|
background: #f0f0f0;
|
|
border-right-color: silver;
|
|
border-right-style: solid;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div style="position:relative">
|
|
<div style="width:600px;">
|
|
<div id="myGrid" style="width:100%;height:500px;"></div>
|
|
</div>
|
|
|
|
<div class="options-panel">
|
|
<h2>Demonstrates:</h2>
|
|
<ul>
|
|
<li>Checkbox row select column</li>
|
|
</ul>
|
|
<h2>View Source:</h2>
|
|
<ul>
|
|
<li><A href="https://github.com/mleibman/SlickGrid/blob/gh-pages/examples/example-checkbox-row-select.html" target="_sourcewindow"> View the source for this example on Github</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script src="../lib/firebugx.js"></script>
|
|
|
|
<script src="../lib/jquery-1.7.min.js"></script>
|
|
<script src="../lib/jquery-ui-1.8.16.custom.min.js"></script>
|
|
<script src="../lib/jquery.event.drag-2.2.js"></script>
|
|
|
|
<script src="../slick.core.js"></script>
|
|
<script src="../plugins/slick.checkboxselectcolumn.js"></script>
|
|
<script src="../plugins/slick.autotooltips.js"></script>
|
|
<script src="../plugins/slick.cellrangedecorator.js"></script>
|
|
<script src="../plugins/slick.cellrangeselector.js"></script>
|
|
<script src="../plugins/slick.cellcopymanager.js"></script>
|
|
<script src="../plugins/slick.cellselectionmodel.js"></script>
|
|
<script src="../plugins/slick.rowselectionmodel.js"></script>
|
|
<script src="../controls/slick.columnpicker.js"></script>
|
|
<script src="../slick.formatters.js"></script>
|
|
<script src="../slick.editors.js"></script>
|
|
<script src="../slick.grid.js"></script>
|
|
|
|
<script>
|
|
var grid;
|
|
var data = [];
|
|
var options = {
|
|
editable: true,
|
|
enableCellNavigation: true,
|
|
asyncEditorLoading: false,
|
|
autoEdit: false
|
|
};
|
|
var columns = [];
|
|
|
|
$(function () {
|
|
for (var i = 0; i < 100; i++) {
|
|
var d = (data[i] = {});
|
|
d[0] = "Row " + i;
|
|
}
|
|
|
|
var checkboxSelector = new Slick.CheckboxSelectColumn({
|
|
cssClass: "slick-cell-checkboxsel"
|
|
});
|
|
|
|
columns.push(checkboxSelector.getColumnDefinition());
|
|
|
|
for (var i = 0; i < 5; i++) {
|
|
columns.push({
|
|
id: i,
|
|
name: String.fromCharCode("A".charCodeAt(0) + i),
|
|
field: i,
|
|
width: 100,
|
|
editor: Slick.Editors.Text
|
|
});
|
|
}
|
|
|
|
grid = new Slick.Grid("#myGrid", data, columns, options);
|
|
grid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow: false}));
|
|
grid.registerPlugin(checkboxSelector);
|
|
|
|
var columnpicker = new Slick.Controls.ColumnPicker(columns, grid, options);
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|