Wednesday, 1 October 2014

Reverse the ListView Action buttons.

Greetings from 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');   

  class AccountsViewList extends ViewList {
    public function preDisplay()
      $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');   

  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.

Urdhva Tech Pvt. Ltd. Powered by Blogger.

Urdhva Tech

My Photo
SugarCRM Consultants Contact us at Skype : urdhvatech

Search This Blog


Stay connected Socially


Total Pageviews

Popular Posts