TreeGrid Header font size & weight

Develop and Deploy Cross-Browser Web Apps .

TreeGrid Header font size & weight

Postby joedarock » Tue Jun 28, 2016 4:22 pm

I'm having trouble dynamically setting the TreeGrid header font size & weight. Can you provide an example?

Joe
joedarock
 
Posts: 161
Joined: Thu Nov 19, 2015 8:39 pm

Re: TreeGrid Header font size & weight

Postby support » Tue Jul 05, 2016 4:50 am

tg.updateHeader("col1",{headerStyle:"font-weight:bold"});
support
 
Posts: 350
Joined: Sat Apr 27, 2013 9:22 am

Re: TreeGrid Header font size & weight

Postby joedarock » Tue Jul 05, 2016 11:35 am

This doesn't seem to do anything.

I have a TreeGrid named 'popBox' that is initialized with 2 rows as follows:
popBox.setHeader([{
id : "1",
//headerStyle : "font-size : 12pt",
caption : "String " + strNum + " Details",
width : 135,
type : "label"},
{id : "2",
caption : " ", //blank
width : 135,
type : "label"
}])

This much works. Now, if I add this line:

popBox.updateHeader("1",{headerStyle:"font-size:24pt"});

I expect the font size to change, but nothing happens. Same for colors, etc. This same approach does change formats on other lines in the grid, but not the header.
joedarock
 
Posts: 161
Joined: Thu Nov 19, 2015 8:39 pm

Re: TreeGrid Header font size & weight

Postby joedarock » Tue Nov 15, 2016 6:09 pm

I posted this request back in July.

I'm trying to change the header font size in a tree grid. I'm using:

tg.updateHeader("col1",{headerStyle:"font-size:24pt"});

This doesn't do anything at all.

Please advise what's wrong.
joedarock
 
Posts: 161
Joined: Thu Nov 19, 2015 8:39 pm

Re: TreeGrid Header font size & weight

Postby support » Wed Nov 16, 2016 4:22 am

You can try the second way:

   
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.Block")
.setHost(host,"xui_ui_block2")
.setLeft(110)
.setTop(20)
.setWidth(320)
.setHeight(180)
.setBorderType("inset")
);

host.xui_ui_block2.append(
xui.create("xui.UI.TreeGrid")
.setHost(host,"xui_ui_treegrid2")
.setLeft(0)
.setTop(0)
.setEditable(true)
.setHeaderHeight("40")
.setRowHandler(false)
.setHeader([{
"id" : "label",
"caption" : "label",
"width" : 8,
"flexSize" : true,
"type" : "label"
},
{
"id" : "input",
"caption" : "input",
"width" : 8,
"flexSize" : true,
"type" : "input"
},
{
"id" : "combobox",
"caption" : "combobox",
"width" : 8,
"flexSize" : true,
"type" : "combobox"
}])
);

append(
xui.create("xui.UI.HTMLButton")
.setHost(host,"xui_ui_htmlbutton1")
.setLeft(140)
.setTop(220)
.setWidth(100)
.setHeight(22)
.setHtml("Modify col1")
.onClick("_xui_ui_htmlbutton1_onclick")
);

append(
xui.create("xui.UI.HTMLButton")
.setHost(host,"xui_ui_htmlbutton2")
.setLeft(270)
.setTop(220)
.setWidth(100)
.setHeight(22)
.setHtml("Modify col2")
.onClick("_xui_ui_htmlbutton2_onclick")
);

return children;
// ]]Code created by CrossUI RAD Studio
},
_xui_ui_htmlbutton1_onclick:function (profile, e, value){
var ns = this, uictrl = profile.boxing();
ns.xui_ui_treegrid2.updateHeader('label',{headerStyle:"font-size:24pt"});
},
_xui_ui_htmlbutton2_onclick:function (profile, e, value){
var ns = this, uictrl = profile.boxing();
ns.xui_ui_treegrid2.getSubNodeInGrid('HCELLCAPTION',null,'input').css('font-size', '24pt');
}
}
});
   
support
 
Posts: 350
Joined: Sat Apr 27, 2013 9:22 am

Re: TreeGrid Header font size & weight

Postby joedarock » Wed Nov 16, 2016 2:26 pm

Method #2 works. Where is this method documented?
joedarock
 
Posts: 161
Joined: Thu Nov 19, 2015 8:39 pm


Re: TreeGrid Header font size & weight

Postby joedarock » Thu Nov 17, 2016 1:44 pm

This is very useful...thanks

In general, I might find the answers to many of my questions by querying the API, but the Search function isn't very capable. It's case sensitive, and only returns subjects based on the method or property title (or so it seems to me). There doesn't seem to be any way to search on text within the subject, is there? You need to know almost the exact title of what you're looking for and I never would have guessed that the solution to setting a font property would involve using a Get function.
joedarock
 
Posts: 161
Joined: Thu Nov 19, 2015 8:39 pm

Re: TreeGrid Header font size & weight

Postby support » Thu Nov 17, 2016 2:51 pm

Thank you for the suggestion, we will strengthen API search function in the next version.
support
 
Posts: 350
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 0 guests

cron