How to turn off the record count at Listview, Subpanel in Sugar7.7

Hello,

I need to hide Total (20 of 21+) because of no need to fire query for fetching count unused query & no need to occupy database resource for that count query.

This runs an extra query on the database server for each sub-panel shown, and is a performance hit which we’d rather not have for a feature which isn’t particularly of interest.

Screen+Shot+2016-04-14+at+10.32.28+PM.png

Thanks

Offshore Evolution Pvt. Ltd.

Parents
  • Hi Offshore,

    In order to remove records counts, you can simply duplicate 'clients/base/views/list-headerpane/list-headerpane.php' into custom folder like 'custom/clients/base/views/list-headerpane/list-headerpane.php'

    Then you can delete or command following lines;

    $viewdefs['base']['view']['list-headerpane'] = array(
        'fields' => array(
            array(
                'name' => 'title',
                'type' => 'label',
                'default_value' => 'LBL_MODULE_NAME',
            ),
            // array(
            //     'name' => 'collection-count',
            //     'type' => 'collection-count',
            // ),
        ),
        'buttons' => array(
            array(
                'name'    => 'create_button',
         .
         .
         .
    

    This would remove that counters from list-headerpanes.

    Best Regards

    Tevfik Tümer

    Developer Support Engineer

Reply
  • Hi Offshore,

    In order to remove records counts, you can simply duplicate 'clients/base/views/list-headerpane/list-headerpane.php' into custom folder like 'custom/clients/base/views/list-headerpane/list-headerpane.php'

    Then you can delete or command following lines;

    $viewdefs['base']['view']['list-headerpane'] = array(
        'fields' => array(
            array(
                'name' => 'title',
                'type' => 'label',
                'default_value' => 'LBL_MODULE_NAME',
            ),
            // array(
            //     'name' => 'collection-count',
            //     'type' => 'collection-count',
            // ),
        ),
        'buttons' => array(
            array(
                'name'    => 'create_button',
         .
         .
         .
    

    This would remove that counters from list-headerpanes.

    Best Regards

    Tevfik Tümer

    Developer Support Engineer

Children
    1. // array( 
    2.         //     'name' => 'collection-count', 
    3.         //     'type' => 'collection-count', 
    4.         // ), 

    Yes, it's working fine.

    But after that I hope count query should not run for query burden.

    But one more questions,

    How to turn off record count subpanel level ?

    I have tried custom/clients/base/views/panel-top/panel-top.php

    $viewdefs['base']['view']['panel-top'] = array(

        'buttons' => array(

            array(

                'type' => 'actiondropdown',

                'name' => 'panel_dropdown',

                'css_class' => 'pull-right',

                'buttons' => array(

                    array(

                        'type' => 'sticky-rowaction',

                        'icon' => 'fa-plus',

                        'name' => 'create_button',

                        'label' => ' ',

                        'acl_action' => 'create',

                        'tooltip' => 'LBL_CREATE_BUTTON_LABEL',

                    ),

                    array(

                        'type' => 'link-action',

                        'name' => 'select_button',

                        'label' => 'LBL_ASSOC_RELATED_RECORD',

                    ),

                ),

            ),

        ),

        'fields' => array(

            /*array(

                'name' => 'collection-count',

                'type' => 'collection-count',

            ),*/

        ),

    );