Welcome Guest Search | Active Topics | Sign In | Register

TreeNode Options
PRO POTSDAM GmbH
Posted: Thursday, January 23, 2020 12:38:41 PM
Rank: Advanced Member
Groups: Member

Joined: 6/17/2010
Posts: 35
<eo:TreeView runat="server" id="TreeView1" EnableViewState="False" ClientSideOnItemClick="ClientSideOnItemClick" ClientSideOnCheckStateChanging="treeViewCheckState" ClientSideOnItemMouseOver="treeViewOnMouseover" AutoCheckParent="True" AutoCheckChildren="False" AutoUncheckParent="False" AutoUncheckChildren="False" SingleExpandMode="AllLevels" AllowMultiSelect="True" ControlSkinID="None" style="height:326px;width:350px;text-align:left;background-color:white">
<TopGroup Style-CssText="border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:9pt;padding-bottom:2px;padding-left:10px;padding-right:2px;padding-top:2px;">
<Bindings>
<eo:DataBinding Property="Text" DataField="FolderName"></eo:DataBinding>
<eo:DataBinding Property="Value" DataField="NodeData"></eo:DataBinding>
</Bindings>
</TopGroup>
<CheckBoxImages Visible="True" Margin="3"></CheckBoxImages>
<LookNodes>
<eo:TreeNode ImageUrl="00030301" DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;color:Gray;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;"
CollapsedImageUrl="00030301" ItemID="_Default" NormalStyle-CssText="PADDING-RIGHT: 1px; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; COLOR: black; BORDER-TOP-STYLE: none; PADDING-TOP: 1px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; BORDER-BOTTOM-STYLE: none"
ExpandedImageUrl="00030302" SelectedStyle-CssText="background-color:#316ac5;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:White;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;"></eo:TreeNode>
</LookNodes>
</eo:TreeView>


function ClientSideOnItemClick(e, eventInfo) {

var node = eventInfo.getItem();
node.setChecked(!eventInfo.getItem().getChecked());

var _nodeKlick=node.getValue();
_subKnoten=node.getSubGroup();
if (_subKnoten) {
_subKnoten_[0]=_subKnoten.getItemByIndex(0);

var _state=node.getExpanded()
var _state2=node.getCheckState();

if (_state==true && _state2==0) {
node.setExpanded(false);
}
} else {
var _state2=node.getCheckState();
if (_state2==0) {

//node.CssClass=_treeAbGewaehlt;
//Test
node.CssText='background-color:black; color:black;';
} else {
//node.CssClass=_treeGewaehlt;
//Test
node.CssText='background-color:white; color:white;';
oT01.value=_nodeKlick;
}
}
}


I have a TreeView with activated checkboxes. The problem is that the standard CssClass keeps the CssText "SelectedStyle" when clicking on the tree node, regardless of whether the checkbox is selected or deselected.
This is confusing for the user.
My idea to overwrite the CssClass via javaScript doesn't work either, neither with .CssClass nor with .CssText.
What can I do?


eo_support
Posted: Thursday, January 23, 2020 1:31:46 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

This is not supported directly. The checkbox states are independent from the styles. Specifically:

1. There is no style changes that are associated to checkbox states;
2. All the styles such as SelectedStyle only applies to the "label" portion of the tree node. It does not apply to the checkbox;
3. The TreeNode object is not a DOM object, so you can not modify its style on the client side;

The only thing you can do is to change the TreeNode's Text. For example, if you can use node.setText("<span style='color:red'>test</span>") to display a red "test" in your tree node. However this maybe too overkill in your case.

I did notice that your license subscription has expired. Tech support is covered by the subscription. So if you still have any question, you may wish to consider to renew your subscription to current. This way you can continue receive support and update your version to current.

Thanks!
PRO POTSDAM GmbH
Posted: Friday, January 24, 2020 8:14:31 AM
Rank: Advanced Member
Groups: Member

Joined: 6/17/2010
Posts: 35
Thanks for the note.
I will renew the subscription as soon as possible.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.