TreeView branch selected color

Develop and Deploy Cross-Browser Web Apps .

TreeView branch selected color

Postby joedarock » Thu Dec 08, 2016 1:16 pm

When you unfold a TreeView branch, the branch's background color changes to the "Selected" color (blue-gray). This over-rides any color coding that might have been programmatically applied to the branch. How can I make sure that the desired color stays applied when a tree branch is selected/unfolded.
joedarock
 
Posts: 137
Joined: Thu Nov 19, 2015 8:39 pm

Re: TreeView branch selected color

Postby support » Fri Dec 16, 2016 5:15 am

That's maybe an image background. Try this:
javascript code
.setCustomStyle({
"BAR" : {
"background-color" : "#00FF00",
"background-image" : "none"
}
}
support
 
Posts: 319
Joined: Sat Apr 27, 2013 9:22 am

Re: TreeView branch selected color

Postby joedarock » Wed Feb 15, 2017 4:26 pm

I put this code in the treeView unfold event, but it doesn't seem to have any effect:

treeView.setCustomStyle({"BAR" : {"background-color" : + red + "","background-image" : "none"}});

When the branch has focus, it's still that bluish-gray color.
joedarock
 
Posts: 137
Joined: Thu Nov 19, 2015 8:39 pm

Re: TreeView branch selected color

Postby support » Thu Feb 16, 2017 10:01 am

   
xui.Class('App', 'xui.Module',{
Instance:{
iniComponents : function(){
// [[Code created by CrossUI RAD Studio
var host=this, children=[], append=function(child){children.push(child.get(0));};

append(
xui.create("xui.UI.Div")
.setHost(host,"xui_ui_div13")
.setLeft("12.5em")
.setTop("1.6666666666666667em")
.setWidth("22.5em")
.setHeight("30.833333333333332em")
);

host.xui_ui_div13.append(
xui.create("xui.UI.TreeView")
.setHost(host,"xui_ui_treeview1")
.setItems([{
"id":"node1",
"sub":["node11",{
"id":"node12",
"imageClass":"xui-icon-xui"
},
"node13","node14"],
"caption":"node1"
},
{
"id":"node2",
"iniFold":false,
"caption":"node2",
"sub":[{
"id":"node21",
"caption":"node21"
},
{
"id":"node22",
"caption":"node22"
},
{
"id":"node23",
"caption":"node23"
},
{
"id":"node24",
"caption":"node24"
}]
}])
.setLeft("0em")
.setTop("0em")
.beforeAppend("_xui_ui_treeview1_beforeappend")
.afterFold("_xui_ui_treeview1_afterfold")
.afterExpand("_xui_ui_treeview1_afterexpand")
);

return children;
// ]]Code created by CrossUI RAD Studio
},

_xui_ui_treeview1_afterfold:function (profile,item){
profile.getSubNodeByItemId('BAR',item.id).css('background-color','red');
},
_xui_ui_treeview1_afterexpand:function (profile,item){
profile.getSubNodeByItemId('BAR',item.id).css('background-color','blue');
},
_xui_ui_treeview1_beforeappend:function (profile,child){
var ns = this, uictrl = profile.boxing();
// must before the treeview was rendrered
uictrl.setCustomStyle({
"BAR" : {
"background-image" : "none"
}
});
}
}
});
   
support
 
Posts: 319
Joined: Sat Apr 27, 2013 9:22 am


Return to CrossUI for Web Apps

Who is online

Users browsing this forum: No registered users and 2 guests

cron