-
Notifications
You must be signed in to change notification settings - Fork 422
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
Lock columns out of draggable header re-ordering #64
Conversation
@6pac @ghiscoding - can we see this feature, let me know if you want to patch the conflict. |
There's been a conversation about this before, but I can't find it. |
I used UI-Grid for some time with AngularJS and they called it Pinning and you had to choose which side you want to pin (left or right) and how many columns you want to pin. Obviously you can't pin something in the middle, you can pin the first 2 columns but you can't pin column 2 without column 1 which makes sense, that would be the same thing in Excel |
Ah yes, right about the multiple adjacent cols. I'd prefer if the option was something like pinMode=none, left, right and pinColCount=n, it's messy at the moment, although I suppose if it's used correctly it will lead to the same result. |
@6pac - pinMode=none/left/right and pinColCount=n is good approach. |
but does this PR actually do Pinning? I thought lock actually meant something else.
This is kind of confusing, perhaps I should try the demo. |
Yeah, I'm confused. Likewise, I should try the demo. |
Looks like it does what I thought, just prevents the chosen columns from participating in the column reorder, ie. the locked column header cannot be dragged. I suspect this doesn't prevent a draggable column being dragged to the left or right of the locked columns though, so it may need some more work. The locked columns are disappearing on reorder for me as well, that appears to be a bug. This is patched onto quite an old version of the grid. Do you think this is really worth the trouble? |
@6pac - if you have time you should do. since this is one of the good feature as like as Excel. if you bring this feature definitely its worth. 👍 |
@6pac I think it's still a nice functionality and it's not that big to implement, however this PR has conflicts since the PR is rather old. Not too hard to replicate if the original author or anyone else want to redo the PR. |
It might be worth using mode: none, lockLeft, lockRight, pinLeft, pinRight for future pinning. The thing is, I'm pretty sure with the PR as it is, while you can't drag a locked column to reorder, I'm pretty sure you could drag one of the draggable columns to the left or right of the locked column. Which makes this all a bit foolish without further changes. It just seems quite a bit of work for not a great feature. |
@6pac, @ghiscoding Also If you ask me if you setup your grid and lock the middle column and no other it's the developers fault not your in regards to dragging to either side of a locked column. So if it's not to hard to do allowing for locking and noting that it only works for left or right hand side of the columns should be enough. Although I'm not sure what would happen if you turn on more columns in the case of the right hand side. |
@SatanEnglish Let me rename the title to remove this ambiguity. @6pac |
@ghiscoding I'm not sure they do think that, actually. There definitely is some confusion, particularly with new arrivals, but this is possibly a legitimate non-pinning feature. That's why I'm trying to established some agreed-upon terminology, perhaps 'locked' and 'pinned' are the best? 'Frozen' is the best alternative to 'pinned'. But as I mentioned previously, even if we lock the two left hand columns, I can't see why someone couldn't drag the third (unlocked, draggable) column to the left of the first column. It needs more work on the dragging logic. I'm not sure it's worth the trouble making this feature. Adding true pinning wouldn't be that hard, I just don't think I'm going to have around 10 hours of time to do it. |
Yes but again this PR is just re-ordering of draggable columns. It's far from being pinning/frozen (it's called Frozen Pane in Excel) or whatever you want to call it. I also don't have the 10 hours to spend, though I'm happy we got the row detail plugin done :) Perhaps someone will have time to do it eventually. |
@ghiscoding E.g. Making the checkbox only ever allowed to be in the first column. (no dragging it and no dragging stuff before it) I'm also not likely to find 10 hours. The detail plugin is already being used in a couple of my new web pages. |
http://jlynch7.github.io/SlickGrid/examples/example-frozen-columns.html This is a good example for frozen column(s) |
... and check out this: #26 |
closing this PR since it is really out of date and will be even more once we release our upcoming Roadmap to v4.0 - jQuery removal. We can re-discuss it in the future |
better late than never... I brought back this idea in PR #983 |
Allows the locking of columns so they wont participate in the manual column ordering.