BUG: dv.getActionButtons() with AppGini v5.9x

This bug affects appgini version 5.90 and 5.91.

When creating additional buttons in Detail View (DV) using addGroup + addLink / addButton (seee docs here) there is a duplication of the new AppGini Previous / Next buttons:

This happens as soon as you are calling dv.getActionButtons() or dv.ActionButtons.

Reason

AppGini places Previous/Next buttons in div.btn-toolbar. The function call dv.getActionButtons() creates another div.btn-toolbar as a container for additional custom buttons. This means if there is more then one div.btn-toolbar, those buttons will be appended more than once.

Solution

This bug shall be fixed in upcoming AppGini version 5.92

Workarounds

Alternative (1):
Code change in datalist.php

Change line 1730 of datalist.php

Original code:

.appendTo('#<?php echo $this->TableName; ?>_dv_action_buttons > .btn-toolbar');

Modified code:

.appendTo('#<?php echo $this->TableName; ?>_dv_action_buttons > .btn-toolbar:eq(0)');

Please note that this file will be overwritten during the next generation as long as you have selected it for generation and it is not write-protected.

Alternative (2):
Javascript call for removing extra buttons

Insert those three lines at the end of your hooks/TABLENAME-dv.js:

$j(function(){
    $j(".previous-record:eq(1),.next-record:eq(1)").remove();
});

You can also insert those three lines into hooks/footer-extras.php, wrapped in <script></script> tags.

We are sorry for the inconveniences.