Skip to content

Activate

1
tab.activate();

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
var dv = AppGiniHelper.DV;
var t1 = dv.addTab("tabGeneral", "Maschine", "cog", ["type_id", "vendor_label", "year_of_manufacture", "serialnumber"])
var t2 = dv.addTab("tabAssignment", "Zuordnung", "link", ["partner_id"]);

AppGiniHelper.getMemberID(function(memberID) {
    console.log(memberID);
    if (memberID == "admin") {
        t2.activate();
    }
});

Tip

You can use tab.activate() in combination with getMemberID() function for conditionally fading/hiding or activating tabs depending on the current user:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
var dv = AppGiniHelper.DV;
// add more tabs here
var tabMeta = dv.addTab("tabMeta", "Meta", null,    ["created_on", "created_by", "..."]);
AppGiniHelper.getMemberID(function (memberID) {
  if (memberID !== 'admin') {
    tabMeta.fadeOut();
  } else {
    tabMeta.activate();
  }
});
If current user is not admin, then fade out tabMeta.

If current user is admin, then activate tabMeta.

See also