Kostanos
Kostanos

Reputation: 10404

SugarCRM how to hide edit button from listview

I need to hide edit button from lists in SugarCRM - the small pencil icon in the left part of each item on the list.

The reason I need to hide it, because it opens the popup edit form, which has some bugs, and doesn't run some dependencies. Replacing this popup edit view with the normal edit view through JavaScript could be an option too.

It should be done in upgrade safe way.

Using SugarCRM Pro 6.5.11

Upvotes: 3

Views: 6099

Answers (2)

Cédric Mourizard
Cédric Mourizard

Reputation: 576

You can also do that by code and create a custom list view via a new file in custom/modules/Accounts/views/view.list.php with code near like that:

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

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

class CustomAccountsViewList extends ViewList
{
    public function preDisplay()
    {
        parent::preDisplay();

        # Hide Quick Edit Pencil
        $this->lv->quickViewLinks = false;
    }
}

By this way you have also some additional "option" which you can hide like export button, massupdate form, etc.

Upvotes: 8

egg
egg

Reputation: 1756

An alternative to this is to disable the AjaxUI for the module that is having problems with the popup edit view. You can configure which modules should not use the AjaxUI under System Settings (more info under "Configure Ajax User Interface" here: http://support.sugarcrm.com/02_Documentation/01_Sugar_Editions/05_Sugar_Community_Edition/Sugar_Community_Edition_6.5/Sugar_Community_Edition_Administration_Guide_6.5.0/05_System)

Code-wise, to remove the edit icon will require something more than just editing the listviewdefs.php file.

Upvotes: 2

Related Questions