Skip to content
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

Problems with custom header cell template and column menu #1603

Closed
wattsbn opened this issue Sep 25, 2014 · 8 comments
Closed

Problems with custom header cell template and column menu #1603

wattsbn opened this issue Sep 25, 2014 · 8 comments
Assignees
Milestone

Comments

@wattsbn
Copy link
Contributor

wattsbn commented Sep 25, 2014

I am trying to add a column in 3.0 that mimics the functionality that the showSelectionCheckbox option provides in the 2.x version. I have provided a simple header cell template that just has a checkbox in it and noticed a couple of issues.

  • When you first load the grid, clicking the checkbox does not do anything (unless you click its border). This seems to be related to the column menu because after you drop down a column menu the problem goes away. I think the initial position of the column menu happens to be in the top-left corner of the grid which is over the first column header.
  • There doesn't seem to be a good way to remove the column menu for a specific column. You can remove the dropdown arrow from the template, but as long as the ui-grid-cell-contents class then the dropdown can still be accessed by holding the left mouse button down on it. If I take the class out of the template, then the problem goes away but i lose the default styling. Do I have to just restyle it myself?

I modified one of the doc example to reproduce these problems:
http://plnkr.co/edit/1sd3QAa6V7OhrGu5ityu
(for some reason the icons seem to be messed up in the plunker, not sure why)

@PaulL1
Copy link
Contributor

PaulL1 commented Sep 26, 2014

Is this the show selection to enable selecting rows? If so, is that not what the selection feature already does?

@wattsbn
Copy link
Contributor Author

wattsbn commented Sep 26, 2014

If there is a feature in the 3.0 version that mimics the same functionality as the showSelectionCheckbox option in the 2.x version, then please let me know because I am not aware of it. @PaulL1 I am not really sure what you are referring to. If you are talking about having the user just click anywhere on the row to select the row, then that is not what I am talking about.

Regardless of the feature I am trying to implement, the two issues should still be fixed. I was just trying to give some context.

@c0bra
Copy link
Contributor

c0bra commented Sep 26, 2014

@wattsbn Yes the checkbox to select row feature is in 3.0: http://ui-grid.info/docs/#/tutorial/210_selection

Does that solve your issue?

@wattsbn
Copy link
Contributor Author

wattsbn commented Sep 26, 2014

@c0bra No, it does not solve my issue. The issues I mentioned above are present in that doc example as well.

The column menu shouldn't steal click events from the column header. Maybe it could be as easy as changing the z-order when its not visible.
In that doc example for row selection, the user can remove the selection column (by press-holding the left mouse button) even though it doesn't have a column dropdown. There should be a way to disable the column menu.

@PaulL1 PaulL1 self-assigned this Sep 26, 2014
@PaulL1 PaulL1 added this to the Future milestone Sep 26, 2014
@PaulL1
Copy link
Contributor

PaulL1 commented Sep 26, 2014

I'll take a look at this, the aim being to allow a cleaner method to disable column menus for one or more columns.

PaulL1 added a commit to PaulL1/ng-grid that referenced this issue Sep 27, 2014
…w disableColumnMenu

Also allows disabling the hide column menu option.  Includes
new e2e test for 303 tutorial.
PaulL1 added a commit that referenced this issue Sep 27, 2014
Fix(columnMenu): #1603 #1604 #1614 allow disableColumnMenu
@PaulL1 PaulL1 closed this as completed Sep 27, 2014
@wattsbn
Copy link
Contributor Author

wattsbn commented Sep 27, 2014

@PaulL1 I have looked at your recent merges for disabling the menu column. It does not fix two of the issues that are mentioned here.

  1. Even after disabling the column menu, you can still access it by pressing on the header for a second or two
  2. After the grid is first initialized and before the accessing any of the column menus, the column menu dropdown is on top of the first column header. While it is not visible, it does steal click events.

@PaulL1
Copy link
Contributor

PaulL1 commented Sep 27, 2014

OK, I see that. It's coded for a long press on a mobile device. I can suppress that as well.

PaulL1 added a commit to PaulL1/ng-grid that referenced this issue Sep 29, 2014
…i#1603 angular-ui#1604

Also fixes issue where column menu still displayed with a long press
even where column menu was disabled for that column.
PaulL1 added a commit that referenced this issue Sep 29, 2014
Enhancement(columnMenu) option to suppress removal of sort, #1603 #1604
@wattsbn
Copy link
Contributor Author

wattsbn commented Sep 29, 2014

@PaulL1 Thanks for all the column menu fixes! There was one bug that I mentioned as part of this issue that you hadn't fixed yet. I went ahead and just made a separate issue for it (#1631).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants