ReadOnly row depends on "available" checkbox
by handsoncode
HTML
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.css">
<script src="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.js"></script>
<div id="example1" class="hot handsontable htColumnHeaders"></div>
CSS
.handsontable td.highlightCell {
background-color: #eee;
}
body {
background: #fff;
margin: 0;
padding: 0;
}
JavaScript
document.addEventListener("DOMContentLoaded", function() {
function getCarData() {
return [{
car: "Mercedes A 160",
year: 2014,
ownersByYear: {2013: 'Micheal Pattinson', 2014: 'John Smith', 2015: 'James Anthon'},
owner: 'John Smith',
cleared: false
}, {
car: "Citroen C4 Coupe",
year: 2015,
ownersByYear: {2013: 'Micheal Pattinson', 2014: 'John Smith', 2015: 'James Anthon'},
owner: 'James Anthon',
cleared: false
}, {
car: "Audi A4 Avant",
year: 2015,
ownersByYear: {2013: 'Andrew Sanchez', 2014: 'John Smith', 2015: 'James Anthon'},
owner: 'James Anthon',
cleared: true
}, {
car: "Opel Astra",
year: 2013,
ownersByYear: {2013: 'John Smith', 2014: 'Micheal Pattinson', 2015: 'Andrew Sanchez'},
owner: 'John Smith',
cleared: false
}, {
car: "BMW 320i Coupe",
year: 2013,
ownersByYear: {2013: 'Andrew Sanchez', 2014: 'John Smith', 2015: 'Micheal Pattinson'},
owner: 'Andrew Sanchez',
cleared: true
},
{
car: "Skoda Octavia",
year: 2015,
ownersByYear: {2013: 'Andrew Sanchez', 2014: 'John Smith', 2015: 'Micheal Pattinson'},
owner: 'Micheal Pattinson',
cleared: true
},
{
car: "Hyundai Coupe",
year: 2015,
ownersByYear: {2013: 'Andrew Sanchez', 2014: 'John Smith', 2015: 'Micheal Pattinson'},
owner: 'Micheal Pattinson',
cleared: true
},
{
car: "Peugeot 407",
year: 2014,
ownersByYear: {2013: 'Andrew Sanchez', 2014: 'John Smith', 2015: 'Micheal Pattinson'},
owner: 'John Smith',
cleared: false
},
{
car: "BMW Z3",
year: 2015,
ownersByYear: {2013: 'Micheal Pattinson', 2014: 'John Smith', 2015: 'Andrew Sanchez'},
owner: 'Andrew Sanchez',
cleared: true
}];
}
var example1 = document.getElementById('example1'),
hot1;
hot1 = new Handsontable.Core(example1, {
...