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

Ability to style entire selected treenode #3246

Closed
ceottaki opened this issue Jun 29, 2017 · 2 comments
Closed

Ability to style entire selected treenode #3246

ceottaki opened this issue Jun 29, 2017 · 2 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@ceottaki
Copy link

I'm submitting a ... (check one with "x")

[ ] bug report => Search github for a similar issue or PR before submitting
[X] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior

When a node is selected in a tree, the class ui-state-highlight is added to the span inside the node that contains the text, allowing just the text to be styled when selected. The div that contains the entire node does not change:

image

Expected behavior

It is desirable to allow users to optionally style the entire tree node content when selected:

image

I would suggest that a new class is added, not ui-state-highlight which would contain style already, but an empty class like ui-treenode-content-selected which would allow the user (and theme creators) to add their custom style to it.

I will submit a pull request shortly with this minor change.

What is the motivation / use case for changing the behavior?

The flexibility of styling is a great characteristic of PrimeNG and is great for most components but the tree component is generally less flexible and our designer would like to "flex his muscles" and apply a design change for a selected node in the tree that is applied to the entire node as displayed above.

Please tell us about your environment:
OS: Windows 7 Pro SP1 64-bit
IDE: Visual Studio Code (latest)
node: 6.9.5
npm: 4.3.0

  • Angular version: 4.2.4
  • PrimeNG version: 4.0.3
  • Browser: all
  • Language: TypeScript 2.3.4
ceottaki pushed a commit to ceottaki/primeng that referenced this issue Jun 29, 2017
… the ui-treenode-content div when a node is selected.

This allows someone to style the entire node div, not just the internal span, when a node is selected.
@cagataycivici cagataycivici self-assigned this Aug 7, 2017
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Aug 7, 2017
@cagataycivici cagataycivici added this to the 4.1.3 milestone Aug 7, 2017
@cagataycivici cagataycivici changed the title Tree: when a node is selectable and has been selected, there should be a way to style the entire tree node content div. Ability to style entire selected treenode Aug 7, 2017
@bublai
Copy link

bublai commented Aug 7, 2017

@ceottaki
I have created a project using template "Building Single Page Applications on ASP.NET Core with JavaScriptServices" and used PrimeNg for Tree component.

The environment used:
OS: Windows 8.1, 64-bit
IDE: Visual Studio 2017 Community
node: 7.4.0
npm: 4.0.5
Angular version: 4.1.2
PrimeNG version: 4.1.2
Target Browser: Chrome, IE 9, 10, 11 & Edge
Language: TypeScript 2.3.2

I used the basic Tree i.e. <p-tree [value]="files">
Tree collapse & Expand don't work in IE. Chrome its working fine. I have added recommended JS file but no help,

<script src="~/lib/es6-shim.min.js"></script> <script src="~/lib/system-polyfills.js"></script> <script src="~lib/shims_for_IE.js"></script>

am i missing anything to be added for IE to work !!

@mkroeschel
Copy link

@ceottaki @cagataycivici
Is it possible, that you post an example how I can select the full row when selecting the node?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

4 participants