Custom button not showing

Miro

New member
Hello,

I'm trying to use a custom button on an installed table using instructions from documentation but I can't get the button to show in the form or in the grid or anywhere else. I’ve turned on the feature in config $enable_custom_button_functions = 1; and documented the button in the custom_functions.php file:

$cnt = 0;
$custom_buttons['TestTable'][$cnt]['type'] = 'php_standard';
$custom_buttons['TestTable'][$cnt]['callback_function'] = 'dadabik_dosomething';
$custom_buttons['TestTable'][$cnt]['permission_needed'] = 'none';
$custom_buttons['TestTable'][$cnt]['show_in'][] = 'edit_form';
$custom_buttons['TestTable'][$cnt]['show_in'][] = 'details_page';
$custom_buttons['TestTable'][$cnt]['show_in'][] = 'insert_form';
$custom_buttons['TestTable'][$cnt]['show_in'][] = 'results_grid';
$custom_buttons['TestTable'][$cnt]['label_type'] = 'fixed';
$custom_buttons['TestTable'][$cnt]['label'] = 'DoSomething';
$custom_buttons['TestTable'][$cnt]['confirmation_message'] = 'YouWillDoSomething?';
$custom_buttons['TestTable'][$cnt]['style'] = 'background:#000;width:200px';
$cnt++;

function dadabik_dosomething()
{
//....
}

Am I missing something?


You are using version 10.0-Manarola platinum
PHP Version: 7.3.13
mysql version: 10.3.21-MariaDB-log-cll-lve
Web server: Apache
Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36
 
Hello,

I have compared with my buttons, and I have an extra line:

[pre]
$custom_buttons['export'][$cnt]['position_form'] = 'top';
[/pre]

Please try insert the "position_form" line to your button and try again.

Regards
Michael
 

Miro

New member
Hello,

thanks Michael, your extra line was exactly what was missing in my code. I've added it and it is working fine now.


Regards
Miro
 
Top