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
Multiple row selection using shift #369
Comments
+1 |
1 similar comment
+1 |
I'm using the following code to accomplish this, but plan to submit a pull request to hopefully add support in the core module. The code works as you'd expect - if you use just SHIFT, all other rows outside of the range will be deselected. If you use CMD+SHIFT (or CTRL on Windows), other rows outside of the range will not be deselected.
|
@ceolter I think that if multiple row selection is enabled, the SHIFT key multiple selection should be enabled by default and it shouldn't be a parameter. Do you agree? |
@scotthovestadt yes, shift parameter not neccessary. |
+1 |
nope, on the backlog :( |
Awmagawd I'd really love to have that feature on my grid. Definitely +1! (Any words on this @scotthovestadt ?) |
+1 |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1. Any ETA on when you'll be looking into adding this? |
no. doesn't meant not soon, just not ETA right now. |
I put together a pretty simple workaround given what's available in the existing API:
|
That looks really nice! I'll try that out, because I'm desperate to have the functionality, and report back my findings. In the meantime, why don't you put it all together as a PR? |
After a few trial and error I've got it working. It pains me to say that this has already been implemented by the author, but it's now under a commercial (paid) license. But, for those of you that want to continue using the free stuff, it's going to come in handy. I've done some changes, the reasoning behind them is written in comments above the corresponding lines, starting with
|
@TFrascaroli thanks for adding some fixes to my initial implementation. If you'd like to make a PR on my behalf I'd be more than happy to let you do so since you've improved the code. |
Nah, I really don't care about "I did it, I should get the credit". Furthermore, I don't think it would pass Niall's approval since he clearly states in his project .md that
And third I'm kinda bussy right now 😄 Glad to help 👍 |
Oh, and I found something else, change
to
So it emulates the deselection mecanism intended by the author (https://www.ag-grid.com/angular-grid-selection/index.php) |
re free vs enterprise, all the selection stuff is in the free version. |
I'm sorry if I made you feel that way, not what I intended. I just stated that because I thought you just would discard the hipothetical PR as "you're doing too much" (since you don't want the project to ultimatelly be a community project).
Well, my bad.... but I don't know why I can't get it to work, neither in free nor in enterprise (I'm actually using this code here to make it work). I'll look into it. |
@TFrascaroli lol - no offence taken at all my friend, you brought a smile to my face!! :) |
@ceolter I'm back to spice this a little bit more. The problem is that I now want to use That brings up my question: will you implement click + shift + click selection in the future? The answer has been given, I know, just making sure. If the answer is still yes, will it be mutually exclusive with |
yes i still plan to implement multi row selection. i haven't thought about range selection - but your right, they don't work well together from a usability. i'll need to think it through when i implement as to how they will work together. personally i would only use one of click selection and range selection. |
Ok, I think I have a pretty good idea now of what should happen when you add all of this to the mix. I'll try to make a PR with some ideas and let you all know so you can all try it out. Obviously, you (@ceolter) don't have to merge the PR, but it can serve as a basis for your final implementation. |
@TFrascaroli :) this is deffo high on my list. if you raise a PR, it will be a kick in the bum for me to get it done! |
While you are working on this, keep in mind that this should work when a user is only using check box selection as well as on row click. The above solution doesn't work with a setup that has row click selection disabled. (or it overrides the suppression of the row click selection, and considering the onRowClick event does not fire when a row is selected through a check box, this can be a bit of a pain.) |
You're absolutely right, sir. I missed this completely. I won't be able to
|
@ceolter, @TFrascaroli; I hope this helps.
|
Doh! It doesn't like using 'selectIndex'. So, I modified the for loop in the range selection handler. Also, made it work in either direction (select or unselect).
|
To overcome the issue mentioned by @TFrascaroli. I just modified his code and add a one line change the ag-grid.js file. I tested with multiple selection, single row selection, check box selection, check box multi selection and everything works good. This solution will work whether suppressRowClickSelection is enabled or not. Basically the row selection event will work as per the grid native functionality, Just registered the shift key as one of the multi selected key in ag-grid which will prevent deselection of a selected row.
|
i have implemented this, will be in the next release. |
@ceolter Not trying to put you on the spot, just curious you estimated ETA. This is one of the open items on my POC list. I was going to implement it myself, but if you are going to added it to agGrid core, then I would be better off waiting for you :-) |
if not this week, then next week. that's my estimate. |
Hi @ceolter - thanks for all the work. Just to clarify. Which release is this fix part of? Is it 427 which you just released a few days ago? https://github.com/ceolter/ag-grid/releases/tag/4.2.7 |
no this went in weeks ago. last weeks beta5 release also has it. |
Hi, @ceolter , should it work with virtual paging? It had worked for us when we've used in-memory row model, but then we switched to virtual paging mode with data retrieved from server. Now only Ctrl+Click works for multiple selection, Shift+Click doesn't. We're using 6.0.x at the moment. Can it be related to outdated version? Thanks. |
only works with normal row model. this is because the viewport row model doesn't necessarily have all the rows loaded, so shift selection would only partially work if it was implemented. |
Has anyone attempted to use this with dragging as well? Ideally Click then Drag could select ranges (the same as Shift-Click, then Click). When using with Ctrl it would combine the selections just like the behavior described in this issue. Basically a similar idea to the enterprise feature for Range Selection but acting on full rows. |
@josh Groves When I first saw the feature you're mentioning I was sure it
did what you're describing. It made more sense to me. Later I realized it
was talking about only cell selection, not entire rows.
I also think this would be a desirable effect. +1
Este mensaje y cualquier documento adjunto que lleve consigo es sólo para
la persona o compañía a la que va dirigido y puede contener información
privilegiada, confidencial o cuya revelación o uso esté prohibido. Si el
receptor de esta transmisión no es la persona a quien iba dirigida, o el
empleado o agente encargado de hacer llegar dicho material al receptor
previsto, se le notifica que cualquier uso, forma de reproducción,
difusión, copia, revelación, modificación, distribución y/o publicación de
este mensaje o sus documentos adjuntos por cualquier otro que no sea su
destinatario previsto está estrictamente prohibido por el remitente. Si ha
recibido esto por error, por favor, devuélvalo al remitente y destruya el
mensaje.
This message and any attachments that it may carry are only for the person
or company to which it is addressed and may contain privileged,
confidential and / or sensitive information. If the receiver of this
transmission is not the person to whom it was addressed, or the employee or
agent responsible for delivering this material to the intended recipient,
you are hereby notified that any use, form of reproduction, dissemination,
copying, disclosure, modification, distribution and / or publication of
this message or any of its attachments by any other than the intended
recipient is strictly prohibited by the sender. If you received this as an
error, please notify the sender and destroy the message.
2017-01-11 20:59 GMT+01:00 Josh Groves <notifications@github.com>:
… Has anyone attempted to use this with dragging as well? Ideally Click then
Drag could select ranges (the same as Shift-Click, then Click). When using
with Ctrl it would combine the selections just like the behavior described
in this issue.
Basically a similar idea to the enterprise feature for Range Selection
<https://www.ag-grid.com/javascript-grid-range-selection/> but acting on
full rows.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#369 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJRBXVENawlsd-hUUNjJ6x8-XCx5ttxsks5rRTSHgaJpZM4Fpn5k>
.
|
I am was wondering about multiple row selection using shift to select all rows between the first and second row click, instead of the command click for each individual row. Fairly new otherwise I would fork and attempt to add this in
The text was updated successfully, but these errors were encountered: