Skip to content

Units / Append or Prepend

Add-ons

Prepend (Glyph-) icon and/or text before and/or after any input* field.

  • This does not work for fieldtypes like textarea, date, radiobutton etc., only for input.

1
2
3
4
5
// file: hooks/patients-dv.js
var dv = AppGiniHelper.dv;
dv.getField("weight").prepend("in kg", "download-alt");

dv.getField("height").append("cm","resize-vertical");

Units (alias for append)

This is only a shotcut for .apppend() function without icon, just text. This function is useful for example in every numeric input field where a unit is required like $, €, km, m, cm, kg, g, t, litres, …

1
2
3
4
5
// file: hooks/patients-dv.js
var dv = AppGiniHelper.dv;
dv.getField("mobile")
    .label("Phone")
    .unit("ICE");

Pro-Tip

1
2
3
4
var dv = AppGiniHelper.DV;
 dv.ready(function(){
     dv.getField("memberEmail").prepend("E: ");
 });

1
2
3
4
var dv = AppGiniHelper.DV;
dv.ready(function(){
    dv.getField("memberEmail").prependIcon("envelope");
});

1
2
3
4
var dv = AppGiniHelper.DV;
 dv.ready(function(){
     dv.getField("memberEmail").prepend("Email-Address:        ", "envelope");
 });

1
2
3
4
var dv = AppGiniHelper.DV;
 dv.ready(function(){
     dv.getField("memberEmail").prepend("Email-Address: ").appendIcon("envelope");
 });

See also: