Styling/Selecting a node in DBTreeeview

Forum to discuss the new web client version of Servoy.

Styling/Selecting a node in DBTreeeview

Postby huber » Mon Jan 29, 2024 10:54 am

For NG1, I can style the selected node for a DBTreeview with a background color spanning over the whole width and allowing the selection of the node in any part of the row.

With Developer 2023.12 and using NG2, I use the selector

Code: Select all
.tree-node-active {
   background-color: #b2d8ff;
}

which has 2 drawbacks. Clicking on a level 1 node, it also selects ALL of the child nodes, which of course is not wanted as it is senseless. Second, selecting the node somewhere outside of the text does NOT select the node.

I am looking for a node styling which allows the selection of the node outside the text as well, i. e. selecting the node anywhere in the row, and of course does not select all child node when selecting the parent node (level 1 node in my case).

See in the attached screenshots the selection of a level 2 node (which looks good but selection happens only when clicking on the text part), and the selection of a level 1 node "automatically" selects ALL child nodes.

This seems to be a bug or I am missing the correct styling selector(s)?

Regards,
You do not have the required permissions to view the files attached to this post.
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 518
Joined: Mon May 14, 2012 11:31 pm

Re: Styling/Selecting a node in DBTreeeview

Postby mboegem » Mon Jan 29, 2024 12:24 pm

Hi Robert,

In order to do this, you have to be more specific on the selector.
Code: Select all
.tree-node-active > tree-node-wrapper > .node-wrapper


This selector should do the job
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1752
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Styling/Selecting a node in DBTreeeview

Postby huber » Tue Jan 30, 2024 9:53 am

Hi Marc

Thanks for your remark about to be more specific. Using your selector and adding selectors about the content (text part, i. e. menu name) does the trick. Now the whole selected row (of the menu) has the desired color.

Code: Select all
.tree-node-active > tree-node-wrapper > .node-wrapper, .node-content-wrapper.node-content-wrapper-active:hover, .node-content-wrapper-active.node-content-wrapper-focused {
   background-color: #b2d8ff;
}

What is still open is that the menu node can only be selected on the menu name, not on the whole row, e. g. on the right (empty) side of the menu name. But this seems something to be solved on the tree itself. It works perfectly on a treeview component. But then, this is styled completely different.

Have a good day and best regards
Robert
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 518
Joined: Mon May 14, 2012 11:31 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 31 guests

cron