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

  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.



Urdhva Tech Pvt. Ltd. Powered by Blogger.

Urdhva Tech

My Photo
SugarCRM Consultants Contact us at contact@urdhva-tech.com Skype : urdhvatech

Search This Blog

Loading...

Stay connected Socially

     

Total Pageviews

Popular Posts