Access label by id

Hello,

I have a label in a Toolbar

view:"toolbar", type:"MainBar", data: [ { type:"label", label: "Assets", align:"left", id: "assetsLabel", css:"areaExpanded", click:"toggleAssets()" } ]

Trying to access the label with $$(“assetsLabel”) in the toggleAssets-function throws the error:

What can I do to get the class names of the label?

Thanks in advance

Horst Mürdter
CrossData-Tools

Hello,

$$() can be applied to views (components). To get the property of a data item you need to use item() method:

id:"mytoolbar", view:"toolbar", type:"MainBar", data: [ { type:"label", label: "Assets", align:"left", id: "assetsLabel", css:"areaExpanded", click:"toggleAssets()" } ] ... var label = $$("mytoolbar").item("assetsLabel").label;

Thank you Alexandra,

that works …