Tab press goes to next line when at the end

Hello,

I have several requests which I cannot seem to get working properly. I’ll post them in different threads so it may help others.

I want it so that when a user us pressing tab and jumping across columns that when they hit the final column and press tab it goes to the first column of the next row. I tried hooking the ‘onTab’ event but it never seems to fire:

mygrid.attachEvent("onTab", function (mode) { alert("hello"); });

I never see the alert. No errors appear either. I’m using v.2.6 build 100722 professional of the grid. I’m usually using Google Chrome, but it doesn’t appear to fire that event in any browser. It also doesn’t fire even if I remove ‘mode’ (since most examples show no use of the mode operator). Is it no longer firing properly or am I doing something stupid?

Cheers,

JD

To tab between two grids try to use such custom function.

grid1.attachEvent("onTab", function(mode){ var rowmax=grid1.getRowsNum()-1; var colmax=grid1.getColumnsNum()-1; var row_id=grid1.getSelectedRowId() if (grid1.getRowIndex(row_id)==rowmax&&grid1.getSelectedCellIndex()==colmax){ window.setTimeout(function(){ grid2.selectCell(0,0); grid2.editCell() },1) return false; }; return true });

If issue still occurs please provide a complete demo or any kind of sample or demo link to reconstruct the issue.

Thank you for your fast reply.

I’ll try and get an example built up (it’s integrated into an ASP.NET MVC app so it’s messy to pull out currently).

I’m not trying to tab between grids, I just want to go from the last column in a row, to the first column in the next row. I even have the code for that - the issue is that the event never gets hit. The snippet I have above should pop up an alert box every time I hit tab - it does not.

Do you have a link to a sample that hooks the onTab event? I’d like to see it working.

I’ll post a sample tomorrow for you but would appreciate any answers to my other points :slight_smile: I don’t need to include an extension to make the onTab event work by chance?

Thank you,

  • JD

No any extensions needed to be added to your sample.
Just make sure that you didn’t disabled enableKeyboardSupport() method.

If issue still occurs for you - please open ticket at support.dhtmlx.com/ and provide a complete demo so the issue could be reconstructed.