Results 1 to 3 of 3

Thread: How to set up number of records to be displayed in ListView ?

  1. #1
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Default How to set up number of records to be displayed in ListView ?

    Hi,

    You can set number of records displayed in ALL ListViews in User Interface. But what if you want some modules to show a max. of 5 records to be displayed, and an other module a max. of 10 to be displayed in ListView (for example).

    Is it possible to modify this in the code of the particulary module? If so, how to do this?

    Thanks in advance
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  2. #2
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: How to set up number of records to be displayed in ListView ?

    In a way, yes. But it is not upgrade safe.

    In config_override.php, a script can be created that sets the max listview items variable according to the current module. Remember that whenever config_override.php is overwritten (by editing system settings or upgrading), your modifications will be overwritten. Perhaps it is better to create a config_listviewitems.php and refer to that in config_override.php, so only 1 line needs to be reimplemented.
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

  3. #3
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: How to set up number of records to be displayed in ListView ?

    I believe there is an upgrade safe way to accomplish that approach:

    1. Create the folders and file custom/include/ListView/listview.config.php containing something like that:
    PHP Code:
    <?PHP
    $list_max_entries_per_page 
    = array(
        
    'Accounts' => 15,
        
    'Contacts' => 20,
        
    'Leads' => 25,
        
    'Opportunities' => 30,
    );
    ?>
    2. Create a custom view.list.php for each module you want to customize the number of records per page:
    custom/modules/<ModuleName>/views/view.list.php
    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    require_once(
    'include/MVC/View/views/view.list.php');

    class <
    ModuleName>ViewList extends ViewList {
        function 
    preDisplay() {
            require_once(
    'custom/include/ListView/listview.config.php');

            global 
    $sugar_config;

            
    $sugar_config['list_max_entries_per_page'] = $list_max_entries_per_page[$this->bean->module_dir];
            
    parent::preDisplay();
        }
    }
    ?>
    Regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Increasing Number Of Records In Subpanel
    By darko.topolsek in forum Developer Help
    Replies: 9
    Last Post: 2010-08-13, 08:24 AM
  2. Replies: 8
    Last Post: 2009-01-18, 08:06 PM
  3. Case Number Not Displayed Properly
    By 1stop in forum General Discussion
    Replies: 0
    Last Post: 2007-12-04, 03:13 AM
  4. Replies: 4
    Last Post: 2007-01-02, 11:27 PM
  5. Changing the number of displayed rows in DashLets
    By thomaseskebaek in forum Help
    Replies: 2
    Last Post: 2006-10-27, 01:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •