I thought the following script in a grid would stop adding a new row when the user tabs out of the last field in a grid with inline editing, but alas, it does not seem to work.
config.edit = function(e) {
if (e.model.isNew()) {
debugger;
var grid = e..sender;
grid.cancelChanges();
}
}
I tried the:
parser.m_doNotAddNewOnTab=true
which DOES stop adding a new row, but then, the record is not saved and on the last row, the cursor will tab through all of the columns on the grid (instead of just the editable ones that works on all other rows. This change of behavior will confuse my users.
Just like all of the other rows, I need the record saved when the user tabs out of the last editable field in a grid row.
Any suggestions?
Thanks
Bruce
Stop Inline Editing from adding new record when tabbing
Prevent Add New Row when inline editing a Grid
From Support
In render script of a query:
parser.m_doNotAddNewOnTab = false;
In render script of a query:
parser.m_doNotAddNewOnTab = false;
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Stop Inline Editing from adding new record when tabbing
have you tried it. What happens is that the cursor does not leave the row, but now tabs into EVERY column,
Re: Stop Inline Editing from adding new record when tabbing
Oopsy
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 7523
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Stop Inline Editing from adding new record when tabbing
parser.m_doNotAddNewOnTab=true;
This works fine in our tests. Looking at the code I cannot see how this change can affect which columns are editable or not. Please double check.
This works fine in our tests. Looking at the code I cannot see how this change can affect which columns are editable or not. Please double check.
Aware IM Support Team
Re: Stop Inline Editing from adding new record when tabbing
It does NOT allow me to EDIT additional columns, but the when tabbing in the last editable column of the last row, the cursor will go into all of the other non-editable columns in this row. This behavior is very different from previous rows where the tabbing will only have the cursor enter the 2 editable columns and never enter the 10 other display only columns. This behavior would offer an inconsistent user interface to my customers.
Bruce
Bruce
-
- Posts: 7523
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Stop Inline Editing from adding new record when tabbing
I cannot see how this is possible. Would you be able to prepare and send us a small testing BSV that demonstrates the problem?
Aware IM Support Team
Re: Stop Inline Editing from adding new record when tabbing
OK, you got it.
Create at least 2 records in test file, then run the query, col 2 and 3 are editable, click on col 2 on 1st row, tab it goes to col 3, tab again and it goes to the next row. When you reach the last row, when you tab out of field 3, it goes to field 4, then field 5, etc.
Bruce
Create at least 2 records in test file, then run the query, col 2 and 3 are editable, click on col 2 on 1st row, tab it goes to col 3, tab again and it goes to the next row. When you reach the last row, when you tab out of field 3, it goes to field 4, then field 5, etc.
Bruce
- Attachments
-
- TestInline.bsv.zip
- (37.63 KiB) Downloaded 365 times
-
- Posts: 7523
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Stop Inline Editing from adding new record when tabbing
I don't see a big problem with this behavior - it does kind of move focus to next fields, but it doesn't allow editing them.
In any event it is very hard to change this, so the only workaround is to make sure that the last column in the query is editable.
In any event it is very hard to change this, so the only workaround is to make sure that the last column in the query is editable.
Aware IM Support Team
Re: Stop Inline Editing from adding new record when tabbing
I never said it allowed editing, but the behavior is inconsistent for my end users. They know that when they tab the cursor only goes to the 2 editable fields. Except on the last row. This was a simple demo I sent you. In the real one, there are buttons that the user tabs into. A much larger grid.
However, if you can not fix / change this, then I guess I will have to live with it. In an ideal world, when tabbing out of the last editable field on the grid, it would save the record (which it no longer does, have to have a button to save the record JUST for the last row), and perhaps go back to the 1st editable field.
Bruce
However, if you can not fix / change this, then I guess I will have to live with it. In an ideal world, when tabbing out of the last editable field on the grid, it would save the record (which it no longer does, have to have a button to save the record JUST for the last row), and perhaps go back to the 1st editable field.
Bruce