Results 1 to 9 of 9

Thread: Implementing the Sugar's Default Pagination for Custom Html Page.

  1. #1
    KETANBHALERAO is offline Sugar Community Member
    Join Date
    Sep 2011
    Location
    Pune
    Posts
    21

    Exclamation Implementing the Sugar's Default Pagination for Custom Html Page.

    Hi ,

    Its very urgent.
    I am trying to implement the sugar's default pagination for my custom page.

    Description
    :
    I am generating reports by retrieving the data from sugar database.
    and making a list of it for printing.
    I want to implement the pagination for this page.
    Is there is any way to override sugar's default Pagination(As in ListView) for my custom page.
    Anyone please help me


    I want to implement

  2. #2
    jmertic's Avatar
    jmertic is offline Sugar Community Manager
    Join Date
    Dec 2007
    Posts
    3,996

    Default Re: Implementing the Sugar's Default Pagination for Custom Html Page.

    Why not just embed a ListView into your form? Check out this example in the product for some ideas:

    https://github.com/sugarcrm/sugarcrm.../view.last.php
    John Mertic
    Sugar Community Manager

  3. #3
    KETANBHALERAO is offline Sugar Community Member
    Join Date
    Sep 2011
    Location
    Pune
    Posts
    21

    Default Re: Implementing the Sugar's Default Pagination for Custom Html Page.

    Hi jmetric,

    Thanks for your reply.

    I will have a look at the link and try for the solution

  4. #4
    KETANBHALERAO is offline Sugar Community Member
    Join Date
    Sep 2011
    Location
    Pune
    Posts
    21

    Default Re: Implementing the Sugar's Default Pagination for Custom Html Page.

    Hi jmetric,

    Thanks for your reply yesterday.


    Please help me
    I am in big trouble.
    Not getting how to embed the listview in any simple file.
    Getting confuse as I was seeing view.last.php file

    Can you please guide me how to embed the pagination (listview) for custom page

  5. #5
    jmertic's Avatar
    jmertic is offline Sugar Community Manager
    Join Date
    Dec 2007
    Posts
    3,996

    Default Re: Implementing the Sugar's Default Pagination for Custom Html Page.

    Try this code segment for a guide

    PHP Code:
    <?php

    require_once("include/ListView/ListViewFacade.php");

    // Create the bean for the module you want a listview for
    $mybean = new Account;

    // build listview facade object
    $lvf = new ListViewFacade($mybean$mybean->module_dir0);

    // handle sort order and pagination
    $params = array();
    if(!empty(
    $_REQUEST['orderBy'])) {
        
    $params['orderBy'] = $_REQUEST['orderBy'];
        
    $params['overrideOrder'] = true;
        if(!empty(
    $_REQUEST['sortOrder'])) $params['sortOrder'] = $_REQUEST['sortOrder'];
    }

    // Hide the various action buttons
    $lvf->lv->mergeduplicates false;
    $lvf->lv->showMassupdateFields false;
    $lvf->lv->email false;
    $lvf->template 'include/ListView/ListViewNoMassUpdate.tpl';

    // Now build the ListView and display it
    $lvf->setup(
        
    ''
        
    ''
        
    $params
        
    return_module_language($GLOBALS['current_language'], $mybean->module_dir), 
        
    0
        -
    1,
        
    ''
        
    strtoupper(get_class($mybean)), 
        array(), 
        
    'id'
        
    );

    echo 
    $lvf->display($GLOBALS['app_list_strings']['moduleList'][$mybean->module_dir], 'main'TRUE);
    John Mertic
    Sugar Community Manager

  6. #6
    KETANBHALERAO is offline Sugar Community Member
    Join Date
    Sep 2011
    Location
    Pune
    Posts
    21

    Default Re: Implementing the Sugar's Default Pagination for Custom Html Page.

    Hi John,

    Thank you very much for your help.
    It works.

  7. #7
    rakeshray is offline Sugar Community Member
    Join Date
    Jun 2010
    Location
    Hyderabad (India)
    Posts
    344

    Default Re: Implementing the Sugar's Default Pagination for Custom Html Page.

    Quote Originally Posted by jmertic View Post
    Try this code segment for a guide

    PHP Code:
    <?php

    require_once("include/ListView/ListViewFacade.php");

    // Create the bean for the module you want a listview for
    $mybean = new Account;

    // build listview facade object
    $lvf = new ListViewFacade($mybean$mybean->module_dir0);

    // handle sort order and pagination
    $params = array();
    if(!empty(
    $_REQUEST['orderBy'])) {
        
    $params['orderBy'] = $_REQUEST['orderBy'];
        
    $params['overrideOrder'] = true;
        if(!empty(
    $_REQUEST['sortOrder'])) $params['sortOrder'] = $_REQUEST['sortOrder'];
    }

    // Hide the various action buttons
    $lvf->lv->mergeduplicates false;
    $lvf->lv->showMassupdateFields false;
    $lvf->lv->email false;
    $lvf->template 'include/ListView/ListViewNoMassUpdate.tpl';

    // Now build the ListView and display it
    $lvf->setup(
        
    ''
        
    ''
        
    $params
        
    return_module_language($GLOBALS['current_language'], $mybean->module_dir), 
        
    0
        -
    1,
        
    ''
        
    strtoupper(get_class($mybean)), 
        array(), 
        
    'id'
        
    );

    echo 
    $lvf->display($GLOBALS['app_list_strings']['moduleList'][$mybean->module_dir], 'main'TRUE);
    Hi,

    I want to filter this custom list view .
    I am putting following code
    $params['where'] = " AND status=8";

    But this is not effective,nothing is happening.

    How to filter it , Please give me some idea
    Thanks !
    Rakesh

  8. #8
    jmertic's Avatar
    jmertic is offline Sugar Community Manager
    Join Date
    Dec 2007
    Posts
    3,996

    Default Re: Implementing the Sugar's Default Pagination for Custom Html Page.

    Change the setup() call in the code to this...

    PHP Code:
    $lvf->setup(
        
    ''
        
    ' AND status=8'
        
    $params
        
    return_module_language($GLOBALS['current_language'], $mybean->module_dir), 
        
    0
        -
    1,
        
    ''
        
    strtoupper(get_class($mybean)), 
        array(), 
        
    'id'
        
    ); 
    John Mertic
    Sugar Community Manager

  9. #9
    hoangbao is offline Sugar Community Member
    Join Date
    Aug 2007
    Location
    Saigon - Vietnam
    Posts
    78

    Default Re: Implementing the Sugar's Default Pagination for Custom Html Page.

    Hi John,
    please help me,

    I want to display listview below editview. How can I do?

    Thanks,
    hoangbao
    Last edited by hoangbao; 2012-11-07 at 04:48 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. help implementing and calling custom soap function
    By cmould in forum Developer Help
    Replies: 4
    Last Post: 2011-12-12, 10:34 AM
  2. Pagination in custom module
    By Alexlv4 in forum Developer Help
    Replies: 0
    Last Post: 2011-04-15, 10:01 PM
  3. Page & menu pagination/display issue
    By quakedragon in forum Help
    Replies: 1
    Last Post: 2010-09-21, 05:10 PM
  4. Replies: 0
    Last Post: 2010-08-10, 02:29 PM
  5. Pagination problem in Email search page
    By prabhakarmsc in forum Developer Help
    Replies: 0
    Last Post: 2010-02-01, 11:31 AM

Tags for this Thread

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
  •