8 Answers, 1 is accepted
Please check these forum threads that discuss a functionality similar to the one you want to achieve:
You have to use the saveChanges method when pressing the arrow key and moving to the next Grid cell.
thanx for your replay .
i have check your links before but didn't help me
actually i don't want to save changes to server while pressing down or up arrows.
just i want to have the small red thing on the cell after going to next cell by the arrows.
because now when i putting a value to cell A then i press down arrow and finally my cell A will be empty , its like you didnt put any value to cell A.
i did a trick by calling
before activating next cell and i get what i want. but by this way i got scroll issues like if you have a long table then by pressing arrows to navigate to next cell then the grid scroll stays at middle of the screen always.
so this trick is not a real solution to my problem.
i appreciate your help.
waiting for you :)
Can you send me the modified project in which you experience the reported behavior when applying the "trick"? If you don't want to publicly expose your code, you can submit a support ticket with the modified project and we will handle it.
Here is the modified definition of the logic executed on "up" and "down" arrow keypress:
var currentCellIndex = current.cellIndex; var nextRow = current.parent().next(); var nextCell = nextRow.find('td').eq(currentCellIndex); var scrollPosition = $(document).scrollTop(); grid.table.focus(); grid.current(nextCell); grid.editCell(nextCell); $(document).scrollTop(scrollPosition);
Let me know if the proposed approach resolves your issue.
your solution worked very good.
but in down arrow the scroll is not moving when you got end of the page ( not the table records )
i have updated the Dojo demo , please check it.
Thanks in Adcance
You can check this Dojo example. It demonstrates how we can achieve the desired scrolling when the "arrow down" is pressed.
Now if you press the "arrow up" and then the "arrow down" the Grid will start to scroll down but the offset of the "last field" to the bottom of the window will be different from the initial one. You can compensate this offset by implementing a similar to the proposed implementation but in the "arrow up" logic.
If we talk in general, you can implement a logic that gets the current position of the active Grid cell and move the page's scroll according to the cell's position on the page.
Thank you very much.
now everything is working perfectly