I have a case where users do not want to use the buttons to create new rows in the grid. Instead they want to have the rows created when they tab out of some input controls. I was able to achieve this but ran into a problems with Shift+Tab or clicking outside the grid with out tabbing out. Below is the approach:
1. I have a text box just above the grid. I am creating new row once the user leaves that text box.
2. I will create a second new row if they tab out of the last input control in the grid.
3. I will delete the existing row and stop creating a new row if they tab out of all the controls in a grid row with out entering anything. Row will be deleted once the user tabs out of the last control in the grid.
This is perfectly working if they follow this exactly. But at any point if they come out of the Grid by using mouse and then do a Shift+Tab to go back into the Grid they are stuck in there and cannot get out of the grid. I have noticed this is happening because of the empty row that is already in the grid which is not deleted. To avoid this scenario I want to change the Point 3 above such that I will delete the row even if the user comes out of the grid from any control in the grid line.
However when I try to do this, using removeRow() is not deleting the row when I use it for the first control but it works if I uses it in blur of the second control (Considering only two column for the row)
Here is the DoJo for the case but this one has a problem as this is not even deleting the row at all where as I can delete the row from the second control in my application.
In simple words what I want to achieve is : I want to delete the rwo if user tabs out with our entering anything in the input control.
I cannot use Cancel changes as I am saving the records along with other information on the form. Cancel changed delete all unsaved records from grid which is not suitable for my case.
1. I have a text box just above the grid. I am creating new row once the user leaves that text box.
2. I will create a second new row if they tab out of the last input control in the grid.
3. I will delete the existing row and stop creating a new row if they tab out of all the controls in a grid row with out entering anything. Row will be deleted once the user tabs out of the last control in the grid.
This is perfectly working if they follow this exactly. But at any point if they come out of the Grid by using mouse and then do a Shift+Tab to go back into the Grid they are stuck in there and cannot get out of the grid. I have noticed this is happening because of the empty row that is already in the grid which is not deleted. To avoid this scenario I want to change the Point 3 above such that I will delete the row even if the user comes out of the grid from any control in the grid line.
However when I try to do this, using removeRow() is not deleting the row when I use it for the first control but it works if I uses it in blur of the second control (Considering only two column for the row)
Here is the DoJo for the case but this one has a problem as this is not even deleting the row at all where as I can delete the row from the second control in my application.
In simple words what I want to achieve is : I want to delete the rwo if user tabs out with our entering anything in the input control.
I cannot use Cancel changes as I am saving the records along with other information on the form. Cancel changed delete all unsaved records from grid which is not suitable for my case.