Skip to content

Detail View Helpers

Get primary key (id) of current record

Warning

ID is not available in insert mode because in Insert Mode record has not been saved, yet, and therefore did not get a primary key.

1
2
3
var dv = AppGiniHelper.dv;
var id = dv.getSelectedID();
console.log(id);

Insert Mode

Detect if we are in insert-mode of DV:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
var dv = AppGiniHelper.dv;
if (dv.isInsert()) {

    // for example hide certain fields
    // note: in insertMode there is no ID, yet

} else {

    var id = dv.getSelectedID();
    console.log(id);

}

Update Mode

Detect if we are in update-mode of DV:

1
2
3
4
5
6
var dv = AppGiniHelper.dv;
if (dv.isUpdate()) {

    // for example activate certain tab or show certain fields

}

Show Field Names

1
2
var dv = AppGiniHelper.dv;
dv.showNames();

// TODO KSE Bild hier

Show Fields Types

1
2
var dv = AppGiniHelper.dv;
dv.showTypes();

// TODO KSE Bild hier


Insert Alert

1
2
3
4
5
6
7
var dv = AppGiniHelper.dv;
dv.getField("birth_date")
    .insertAbove()
    .alert(".alert(\"Text\", Variation.info)", Variation.info)
    .alert(".alert(\"Text\", Variation.success)", Variation.success)
    .alert(".alert(\"Text\", Variation.warning)", Variation.warning)
    .alert(".alert(\"Text\", Variation.danger)", Variation.danger);

Insert Paragraph

1
2
3
4
5
6
7
8
var text = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et";

var dv = AppGiniHelper.dv;
dv.getField("birth_date")
    .insertAbove()
    .p(text)
    .p(text, "lead") // css classname "lead"
;

Insert Heading

1
2
3
4
5
6
7
8
var dv = AppGiniHelper.dv;
dv.getField("birth_date")
    .insertAbove()
    .h1(".h1 Heading 1", "page-header")
    .h2(".h2 Heading 2")
    .h3(".h3 Heading 3")
    .h4(".h4 Heading 4")
    .h5(".h5 Heading 5");

See also