SugarCRM:在子面板中有条件地隐藏/显示编辑和删除按钮

I have created a custom module and related it to the leads module. It has certain custom columns such as "Type", "Notes" and so on.

The "Type" column can have 2 values i.e. "Call" and "Auto".

I want to show / hide the edit and delete buttons based on the value in the Type column. What's the best way to do this? enter image description here

OcultarClass('listViewTdToolsS1');

function OcultarClass(matchClass)    {
    var elems = document.getElementsByTagName('*'),i;
    for (i in elems)
        {
        if((" "+elems[i].className+" ").indexOf(" "+matchClass+" ") > -1)
            {
            elems[i].style.display = 'none';
            }
        }
    }