setting font-size in view:"label"

Hi,
How I can change the default font-size (.dhx_el_label) only for a concrete label, in the definition of the component (not by code)?

thanks
javi.

  1. of all I have tried, only works for me:
    $$(‘peso’)._viewobj.className=‘font12’;
    or this: $$(‘peso’).getNode().className=‘font12’;
    But, I would prefer to specify this in design and not by code…

I have tried to define a new style and set it on css attribute, but it goes after dhx_el_label therefore doesn’t apply.
{view:“label”, label: “peso:”, id: “peso”, height:“20”, align:“right”,css:“font12 opacidad60”},

peso:

I have tried specify font-size:“12” inside view:“label”, but it crashs with: “missing : after property id”

I have tried specify “font-size”:“12” inside view:“label”, but it’s ignored:

{view:“label”, label: “peso:”, id: “peso”, “font-size”:12, “font-weight”: “normal”, height:“20”, align:“right”,css:“opacidad60”},

peso:

I have tried to define a new type
(docs.dhtmlx.com/touch/doku.php?i … es_styling),
but it crashed. (and with “font-size” it crashes with: “missing : after property id”)

dhx.Type(dhx.ui.label,{
name:“mini12”,
height: 45
});
{view:“label”, type=“mini12”, label: “peso:”, id: “peso”, height:“20”, align:“right”},

touchui_debug.js (línea 2032) obj.type is undefined : obj.type.name=“default”
code fragment:[
dhx.Type=function(obj, data){
if (obj._dhx_proto_wait){
if (!obj._dhx_type_wait)
obj._dhx_type_wait = [];
obj._dhx_type_wait.push(data);
return;
}

//auto switch to prototype, if name of class was provided
if (typeof obj == "function")
	obj = obj.prototype;
if (!obj.types){
	obj.types = { "default" : obj.type };
	obj.type.name = "default";              ***** 2032, error line ****
}


]

even I have tried to define a “default” before “mini12”, but anyway it crashes too in line 2032
dhx.Type(dhx.ui.label,{
name:“default”,
height:40
});

I have tried setting a style attribute, it’s ignored
{view:“label”, style:“font12”, label: “peso:”, id: “peso”, height:“20”, align:“right”,css:“opacidad60”},

peso:

Hi Javi,

The approach 1) in the list is correct. However, css property is applied to the parent (view) div. And font-size:22px is set for its node. Therefore, css should be like so in this case:

.dhx_el_label.font12{ line-height: 20px; } .dhx_el_label.font12 div{ font-size: 12px; }
  1. can also be used. However, it removes all default css properties.It redefines the className of label view. And the approach 1) just adds new css rule to existent.

Method 3) can be applied only to “multidata” components, e.g. list, grid, dataview