Fields

Hide single field

// file: hooks/patients-dv.js
new AppGiniField("id").hide();

Pass the fieldname as string.

Hide multiple fields

// file: hooks/patients-dv.js
new AppGiniFields(["id", "last_name", "first_name"]).hide();

Pass an array of fieldnames.

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.

// file: hooks/patients-dv.js
new AppGiniField("weight")
  .prependIcon("download-alt")
  .append("kg");
new AppGiniField("height")
  .prependIcon("resize-vertical")
  .append("cm");
// file: hooks/patients-dv.js
new AppGiniField("weight")
  .prepend("in kg", "download-alt");

new AppGiniField("height")
  .append("cm","resize-vertical");

When adding (glyph-) icons you only need to pass the name of the icon. If for example the glyphicon is “glyphicon-cog”, just pass “cog” as argument to .prepend() or .prependIcon() functions.

All available glyphicons can be found here:

https://getbootstrap.com/docs/3.3/components/#glyphicons
https://glyphicons.bootstrapcheatsheets.com

Unit

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, …

// file: hooks/patients-dv.js
new AppGiniField("mobile")
    .label("Phone")
    .unit("ICE");

Placeholders

NEW 2019/09/23

Placeholders, those gray helptexts inside input fields, can give additional help.

new AppGiniField("tiny_uint")
    .placeholder("0...255");

Insert content

Since 2019/10

You can now insert insert certain elements before or after any field or above or below the row.

new AppGiniField("birth_date")
.insertAbove()
.h1("Heading 1", "page-header")

new AppGiniField("birth_date")
.insertAbove()
.h1("Heading 1", "page-header")
.h2("Heading 2");

Placement

Social media & sharing icons powered by UltimatelySocial