Hi,
I have a a form with a couple of fields and a kendo grid , and im implementing my own custom navigations using the enter and tabe keys.
I got the navigation inside of the form working perfectly, however im having some problems tso i would like to get some assistance to help me acomplish a few things, namely :
1 -Open grid on focus : If the cursor is on the last field on my form (the field just before the grid), and i press tab, i would like to open the last line on the grid on edit mode. However i cannot catch the focus event on the grid.
2 -If a row on the grid is selected, i cannot put that row on edit mode by pressing the enter key. I have already figured out how to catch the keydow event, but as it stands the grid only catches the keydown event when its already in edit mode.
3 -I have the navigation inside the grid partially sorted out, the problem emerges when i get to the last column. When i'm exiting the last cell/colum on a row, i want to save the row and then add a new row to the grid. The complicated bit is that i only want the new row to be added if the current row is saved sucessfully.
In my code if the row is valid i call the save row method.
if( grid.editable && grid.editable.validatable.validate()){
grid.saveRow();
// follow up logic
}
However dispite of the row validation returning true, sometimes the validations on the server side still fail. So far I have no problem displaying the errors returned by the ModelState inside the grid on the respective fields. I want the grid to keep that row, selected, open, and in edit mode displaying the validations errors when the model state is not valid. But if there are not any erros i would like to close the current row ro be close and a new row to be added.
The issue here is that the error even is part of the datasource and not part of the grid, so i don't really know here to put that logic; especially because i also do not know how to check if the saveRow() method returned any errors (from the server side) or executed sucessfully.
<
p
>Eg : <
br
>if(grid.dataSource.saveRow(()){ <
br
>//current row is saved + new row is added. <
br
> } <
br
>//else will be handled by the grid error handler</
p
><
p
><
div
class
=
"reCodeBlock"
style
=
"border:solid 1px #7f9db9;width:;height:;overflow-y:auto;"
><
div
style
=
" background-color: #fff;"
></
div
></
div
></
p
>
4 - As i said before my grid is part of a master form, and it is required that the grid is submited at once with the form, therefore i do not want the grids to immediatly propagate the changes to a remote location in case of insert, update or delete. But at the same time i do not want the changes teh users make on the grid to be reverted in case of a datasource.read() or grid.cancelChanges(). So i would like to have the data saved on the grid, just do not want it to be saved to the db before the data on the form is saved.
Thanks in advance for your assistance.