i have handsontable grid (handsontable) , limit navigation first 2 columns (a,b). when user starts on a1 , uses tab navigate b1, a2, b2, a3, b3 etc. , when reaches end of table go backup a1.
is there way this?
$(document).ready(function () { var container = document.getelementbyid('basic_example'); var data = function () { return handsontable.helper.createspreadsheetdata(100, 12); }; var hot = new handsontable(container, { data: data(), height: 400, colheaders: true, rowheaders: true, stretchh: 'all', columnsorting: true, contextmenu: true }); });
used link provided mpuraria above , got working. navigation order has been restricted first 2 columns when using tab key. jsfiddle.
$(document).ready(function () { var container = document.getelementbyid('basic_example'); var data = function () { return handsontable.helper.createspreadsheetdata(10, 9); }; var hot = new handsontable(container, { data: data(), height: 400, colheaders: true, rowheaders: true, stretchh: 'all', columnsorting: true, contextmenu: true }); handsontable.dom.addevent(document.body, 'keydown', function(e) { if (e.keycode === 9) { e.stoppropagation(); var selection = hot.getselected(); var rowindex = selection[0]; var colindex = selection[1]; //rowindex++; colindex++; if (colindex > 1) { rowindex++; colindex = 0; } hot.selectcell(rowindex,colindex); } }); });
Comments
Post a Comment