-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to disable auto-edit for new row #445
Comments
Good points. I think we need a more nuanced way than a setting, I'll look into this. The plugin should be able to ignore whatever setting exists and just insert the rows regardless. |
- fixes #445 - when using CellExternalCopyManager and user wants to paste cell selection range, it could be useful to not automatically open the cell that was clicked even if it has an editor defined
better late than never, now available in latest version 5.1.0, I decided to go with the proposed code change because I don't think there are better ways that I can think of to determine if we should use the cell editor or not, so I think this proposition was ok and I also kept the proposed name as well Lastly please note that a lot changed since this issue was created, we dropped jQuery/jQueryUI and we migrated to TypeScript |
It seems that for the new row, auto-edit is enabled by default and can't be turned off (unless I'm missing something). this can be seen in
slick.grid.js
on line 4777 in functionsetActiveCellInternal
:This is called when navigating to a cell either by click or by keys and in that case
opt_editMode
is passed into the function asnull
.This causes a problem with the
cellexternalcopymanager
. I want to paste one or more new rows but that doesn't work if the editor for that cell is automatically enabled on entering the cell.This can be easily seen in the example. Pasting only new rows into first unnamed column works, because that column has no editor assigned. Pasting into other columns with an editor doesn't work because the editor blocks the pasting.
If I comment above code, then it also works for cells with an editor assigned with the downside that triple-click is needed to activate the cursor in the editor. This also isn't ideal (and I'm not sure why triple-click is needed) but my suggestion is to add an option to disable auto-edit on new rows (and allow the edit with a double-click, not sure how).
if (opt_editMode == null && options.autoEditNewRow) { opt_editMode = (activeRow == getDataLength()) || options.autoEdit; }
This would make a ton of sense as pasting usually is new data to be appended and not updates to existing data.
The text was updated successfully, but these errors were encountered: