Docs
API
  • textarea

    Textarea field type

    Example

    
    items: [{
      label: 'About',
      type: 'textarea',
      name: 'about',
      emptyText: 'About'
    ...
    

    Properties

    cls

    String

    The CSS class that will be added to field.
    It is used for custom styling field.

    
    items: [{
      label: 'About',
      type: 'textarea',
      name: 'about',
      emptyText: 'About',
      cls: 'field-about'
    },{
    ...
    }]
    

    editable

    Boolean

    It enables/disable editing field value.

    
    ...
    items: [{
      editable: false,
      label: 'About',
      type: 'textarea',
      name: 'about'
    ...
    
    true

    emptyText

    String

    Placeholder text.

    
    ...
    items: [{
      label: 'About',
      type: 'textarea',
      name: 'about',
      emptyText: 'About'
    },{
    ...
    

    events

    Array

    Set event handler to field.

    
    ...
    items: [{
      label: 'About',
      type: 'textarea',
      name: 'about',
      emptyText: 'About'
      events: [{
        change: function(){
          
        }
      }]
    },{
    ...
    

    id

    String

    If to set id, it will be possible to get link on widget over Fancy.getWidget.

    
    tbar: [{
      type: 'textarea',
      id: 'info',
      value: 'Info about Car'
    },{
    ...
    }] 
    
    ...
    var textField = Fancy.getWidget('info');
    
    textField.set('Kia Sportage');
    

    label

    String

    Text of field.

    
    ...
    items: [{
      label: 'About',
      type: 'textarea',
      name: 'about',
      emptyText: 'About'
    },{
    ...
    

    labelAlign

    String

    Align of label.

    Values: right, left, top.

    
    ...
    items: [{
      label: 'About',
      type: 'textarea',
      name: 'about',
      emptyText: 'About',
      labelAlign: 'right'
    },{
    ...
    
    left

    name

    String

    Name of field over which it is possible to get value of field.

    
    ...
    items: [{
      label: 'About',
      type: 'textarea',
      name: 'about',
      emptyText: 'About'
    },{
    ...
    

    type

    String

    Type of field (value - textarea).

    
    {
      label: 'About',
      type: 'textarea',
      name: 'about',
      emptyText: 'About'
    }
    

    value

    Boolean

    Value of field.

    
    items: [{
      label: 'About',
      type: 'textarea',
      name: 'about',
      value: 'About'
    ...
    

    Methods

    blur

    ()

    Blur field.

    
    field.blur();
    

    clear

    ()

    Clear value.

    
    tbar: [{
      type: 'textarea',
      id: 'info',
      value: 'Info about Car'
    },{
    ...
    }] 
    
    ...
    var textField = Fancy.getWidget('info');
    
    textField.clear();
    

    disable

    ()

    Disable field.

    
    field.disable();
    

    enable

    ()

    Enable field.

    
    field.enable();
    

    focus

    ()

    Focus field.

    
    field.focus();
    

    get

    ():String

    return value of field.

    
    tbar: [{
      type: 'textarea',
      id: 'info',
      value: 'Info about Car'
    },{
    ...
    }] 
    
    ...
    var textField = Fancy.getWidget('info');
    
    textField.get();
    

    set

    (value: String)

    Set value of field.

    
    tbar: [{
      type: 'textarea',
      id: 'info',
      value: 'Info about Car'
    },{
    ...
    }] 
    
    ...
    var textField = Fancy.getWidget('info');
    
    textField.set('Kia Sportage');
    

    setWidth

    (value: Number)

    Set new field width.

    
    field.setWidth(400);
    

    Events

    blur

    (field)

    Losing focus from field event.

    
    items: [{
      type: 'switcher',
      label: 'Active',
      name: 'active',
      value: true,
      events: [{
        blur: function(){
          
        }
      }]
    ...
    

    change

    (field, value)

    Change field value event.

    
    items: [{
      label: 'About',
      type: 'textarea',
      name: 'about',
      emptyText: 'About',
      events: [{
        change: function(){
          
        },
        scope: {}//not required
      }]
    ...
    

    focus

    (field)

    Focus field event.

    
    items: [{
      label: 'About',
      type: 'textarea',
      name: 'about',
      emptyText: 'About',
      events: [{
        focus: function(){
          
        }
      }]
    ...