Custom dashlet Auto Refresh not work

Hi,

I try to put config to my custom dashlet but not working no Auto Refresh drop down appear.

I copy some part of code from activitystream-dashlet that can set config Auto refresh. 

Look like this:

How can I fix or I missing something?

My code below

$viewdefs['base']['view']['custom-mydashlet'] = array(
    'dashlets' => array(
        array(
            'label' => 'Hello World',
            'description' => 'Bla bla bla',
            'config' => array(
            ),
            'preview' => array(
            ),
            'filter' => array(
            )
        ),
    ),
    'config' => array(
        'fields' => array(
            array(
                'name' => 'auto_refresh',
                'label' => 'LBL_REPORT_AUTO_REFRESH',
                'type' => 'enum',
                'options' => 'sugar7_dashlet_auto_refresh_options',
            ),
        ),
    ),
);

Sugar 7.6 Ent

Thanks,

M

  • Hi Autchara,

    I can recommend to go through this discussion, there someone implemented something similar: 

    Notifications Dashlet this.render()  fails 

    In their example they used something like:

    $viewdefs['base']['view']['my-notifications'] = array(
        'dashlets' => array(
            array(
                'label' => 'LBL_MY_NOTIFICATIONS_DASHLET',
                'description' => 'List of my notifications',
                'config' => array(),
                'preview' => array(
                ),
            ),
        ),
        'dashlet_config_panels' =>
            array(
                array(
                    'name' => 'panel_body',
                    'columns' => 2,
                    'labelsOnTop' => true,
                    'placeholders' => true,
                    'fields' => array(
                        array(
                            'name' => 'auto_refresh',
                            'label' => 'LBL_REPORT_AUTO_REFRESH',
                            'type' => 'enum',
                            'options' => 'sugar7_dashlet_auto_refresh_options'
                        ),
                    ),
                ),
            ),

    But in order to make it work for a custom dashlet you also need the other code from that post.  

  • Dennis Wangerin Thank you so much for your help.  It's work perfect.

    edit: remove code .js because it will bring huge performance problem.