Top

Text

Contents

Text widget is a simple label widget containing only textual information.The width is optional on the text widget. If width is not set, then the contents of the text widget will not be ellipsed and the text widget will expand to the width of it's contents.

The simple way to add Text widget to your application is as follows

File /widgets/text/Snippet.tpl
{@aria:Text {

     text: "This is the text to be displayed.",
     width : 150,
     ellipsis: "...",
     ellipsisLocation: "right"

 }/}

The whole list of configuration parameters is available in TextCfg bean.

Binding

The bindable properties of text widget are

  • text
  • tooltip
File /widgets/text/Snippet.tpl
{@aria:Text {

     ellipsis: "...",
     ellipsisLocation: "right",
     width:30,
     bind: {
        text : {to: "view:calvalue" , inside: data,
            transform :{
                toWidget : function(text) {
                    var dayDate = new Date(text);
                    var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
                    return weekday[dayDate.getDay()];
                },
                fromWidget : function (text) {
                    return null;
                }
            }
        }
    }

 }/}

For more information please read the article on Widget Bindings.

This page was last modified on 8 January 2013, at 12:18 and has been viewed 955 times.