@peter
@peter
Forum Replies Created
-
AuthorPosts
-
PeterParticipant
Oh, how did I not see this… Sorry about that…
I’m not interested in not ending the edit, I want that, I just don’t want focus to switch to the row below, but instead to next column on the same row, like Tab does.
Hope I can make that happen now, if I spell Enter correctly…PeterParticipantThat is what I have been trying, but it does not work.
onKey(e) { console.log('e.key: '+ e.key); if (e.key === 'Ener') { e.preventDefault(); } }
Despite of this, the Enter key still ends editing and moves focus to the cell below on the next row.
PeterParticipantOk thank you, that makes sense then.
How about preventing Enter key from navigating down in the rows?
I would actually like Enter to act the same way as Tab , which currently ends the ends the editing and moves on to the next cell on the same row.
Pressing Enter however, ends the editing and moves to the cell below in the same column (aka on the next row).
PeterParticipantCan you tell me why it is that selection made with Tab key, doesn’t trigger ‘change’ event?
And if so, how I can make it happen?Right now I can navigate back and forth in the grid with arrow keys and they trigger ‘change’ every time, but Tab doesn’t for some reason.
PeterParticipantSo since the onKey() catches the tab-key before the cell selection changes, I can overwrite the behavior which is good, but there is still an issue that I don’t quite get and that is why the ‘change’ event doesn’t fire when the cell selection is made with the tab-key.
The arrow-keys do make the ‘change’ event fire, but not the tab-key…
Is there a way to get the selected cell as a result of tab-key being pressed? – other than looking at the previous column and then seeing what’s next in line (if any)?PeterParticipantYup I fixed it now – I wasn’t aware that the onKey triggers before the event occurs and so I can at this point check which is the current column.
PeterParticipantI can see that I can disable Tab navigation all together this way, but I actually want the Tab navigation, I just want to prevent Tab on the last cell, to move to the row below (or in my case create a new row, if current row is the last row in the grid).
So that Tab just runs through the cells of the current row and stays on that current row, also when the last cell is reached, in which case navigation should go back to the first cell.
Another thing is that I have noticed something a bit odd about the Tab navigation. If I navigate through the cell with the arrow keys, the ‘change’ event fires, but when I navigate through the cells with Tab, the ‘change’ event is not fired.
PeterParticipantPlease – Is there a way to prevent TAB from navigating to the next row (or creating a new one) when pressed from the last column in the grid?
PeterParticipantThat works – I thought that was what I was doing but apparently I was doing something wrong in my previous code.
PeterParticipantOK, so it turned out that there was a method
focusAndSelect()
that I should use instead ofselectCells()
which I had missed – methods not listed alphabetically…Anyway, using this instead fixed the problem I had.
Is there a way to prevent TAB from navigating to the next row (or creating a new one) when pressed from the last column in the grid?
PeterParticipantlink to demo app and video showing the problem sent.
PeterParticipantWell I had a function that did the entire
Smart('#grid', class...
thing, and I called that when the data changed, but this was where I noticed that the data in the grid, stayed the same even though the data that was being put into the data adapter as data source, was a new set of data.So what part of the grid initialization should be redone (if not all) to switch out all the data in the grid, if not the entire
Smart('#grid', class...
section?PeterParticipantThank you, I will look into that.
PeterParticipantIn response to this (#104637), I can say that the ‘decimalSeparator’ seems to work, but the ‘thousandsSeparator’ is ignored.
PeterParticipantNevermind this – I have now changed the field from number to string … There are way too many problems when using number apparently.
Either there are problems formatting the value in display mode or when in the open editor, or else there are problems (only sometimes though) when trying to type e.g. 300 the editor only allows me to type 30 and then ignores any further zeros being typed. -
AuthorPosts