Skip to content

Custom Content

Add custom HTML tags next to fields

General

1
2
3
4
5
var dv = AppGiniHelper.dv;
dv.getField("fieldname").insertAbove().h1("heading 1");
// ^ ^
// | +--- see available tags below
// +--- see available positions below

Available positions

  • insertAbove()
  • insertBefore()
  • insertAfter()
  • insertBelow()

Available Tags

Headings

  • .h1("Heading 1");
  • ...
  • .h6("Heading 6");

Preformatted text (code)

  • .pre("text");

Paragraph

  • .p("text");

Horizontal line

  • .hr();

Alerts

  • .alert("text", Variation.info);

See Variation

Label

  • .label("text", Variation.info);

Div

  • .div("inner HTML");

Span

  • .span("inner HTML");

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
var dv = AppGiniHelper.dv;

// insert h4 above "created_by" field
dv.getField("created_by").insertAbove().h4("Metadata");

// insert red alert below "is_overdue" field
dv.getField("is_overdue").insertBelow().alert("Task is overdue", Variation.danger);

// new: function is also available for multiple fields (fieldnames as string array)
dv.getFields(["modified_on", "assigned_on", "finished_on"]).insertAbove().hr();

See also: