I'm using HandsOnTables with a web2py app. All seems to work well, except that I cannot get the alter('row_above') or alter('row_below') to work. In the context menu, they are grayed out, and if I invoke them in code, nothing happens. Some digging around turned up a post (somewhere) that these two don't work unless the data source is an array. In fact, when I replace the web2py data source with an array in the HTML for the view, the two add row commands do work as advertised.
The two alter functions work with this:
$(document).ready(function() {
var data = [
{
"id":1,
"last_name":"Abbrederis",
"first_name":"Jason",
"pos":"WR"
},
{
"id":2,
"last_name":"Abbrederis",
"first_name":"Jason",
"pos":"WR"
},
{
"id":3,
"last_name":"Adams",
"first_name":"Davante",
"pos":"WR"
}
];
var hotElement = document.getElementById('list');
datatable = new Handsontable(hotElement, {
data: data,
<...snip rest of table configuration...>
They do not work with this:
var data = {{=XML(injuries.json())}}
var hotElement = document.getElementById('list');
datatable = new Handsontable(hotElement, {
data: data,
<...snip rest of table configuration...>
Any ideas as to how to insert a row in this web2py-based app will be greatly appreciated!