Handsontable sort bug
HTML
<script src="http://handsontable.com/dist/jquery.handsontable.full.js"></script>
<link rel="stylesheet" href="http://handsontable.com/dist/jquery.handsontable.full.css">
<link rel="stylesheet" href="http://handsontable.com/demo/css/samples.css">
<h2>Handsontable sort bug</h2>
<div id="exampleGrid" class="dataTable"></div>
CSS
body {
background-color: white;
margin: 20px;
}
h2 {
margin: 20px 0;
}
JavaScript
var myData = [
{a: false, b: 2, c: 3},
{a: false, b: 10, c: 11},
{a: true, b: 11, c: -4}
];
function customIsEmptyRow(row) {
var data = $("#exampleGrid").handsontable("getData")
return data[row].isNew;
}
$("#exampleGrid").handsontable({
data: myData,
minSpareRows: 1,
rowHeaders: true,
colHeaders: ["A", "B", "C"],
columns: [
{ data: "a", type: "checkbox" },
{ data: "b", type: "text" },
{ data: "c", type: "text" },
],
dataSchema: {isNew: true, a: false}, // default for a to avoid #bad value#
columnSorting: true
//isEmptyRow: customIsEmptyRow
});