01
October

0 Comments | 0 Shares | Urdhva Tech

Interesting question asked on community forum, would love to share its solution!

Question : Can we do a reversal of ListView Action buttons ?

I have done the code for Accounts module. Change it as per your requirement.

(1) Write the following code into custom/modules/Accounts/views/view.list.php

  if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');   

  require_once('include/MVC/View/views/view.list.php');
  class AccountsViewList extends ViewList {
    public function preDisplay()
    {
      parent::preDisplay();
      require_once('custom/include/ListView/ListViewSmartyAccounts.php');
      $this->lv = new ListViewSmartyAccounts();
    }
  }

(2) Write the following code into custom/include/ListView/ListViewSmartyAccounts.php

if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');   

  require_once('include/ListView/ListViewSmarty.php');
  class ListViewSmartyAccounts extends ListViewSmarty {
    function buildActionsLink($id = 'actions_link', $location = 'top')
    {
      $link = parent::buildActionsLink();
      $link['buttons'] = array_reverse($link['buttons']);
      return $link;
    }
  }

(3) Refresh the Accounts Listview page and see the effect.

 

 

 

Download attachments:
Comments
  • No Comments Found.
Post your comment