Grid - certain row record to make read only

Hi,

is it possible to make in a grid certain row record read only? So that I can’t see the pencil for edit?

BR
Stefan

I think no, but you could hide save button in the destination form to avoid the user save data, so it’s similar to read only

I had this in my Notes that I wrote down while experimenting with SC a few versions ago…

//hide edit pencil on grid
//On script Init event
$lvl =[groupid];//this is a field on the Row
if($lvl>1)
{
echo “#bedit{ display:none !important;}”;
}

OR

On application INIT event

$lvl =[groupid];
sc_apl_conf (“app_name”, “lig_edit”, “off”);
if ($lvl==1)
{
sc_apl_conf (“app_name”, “lig_edit”, “on”);
}

2 Likes

create a customized edit field. then you can control it.

  1. Add new field “edit” in grid.

  2. add following code to event onscriptinit
    ======================================================================
    ? >
    script type=“text/javascript”
    function openmyform(id)
    {
    var func_menu_aba = null;
    var padre = null;

    padre = window.top;
    if ( padre ) {
    eval (“func_menu_aba = padre.createIframe”);
    }

    if ( typeof func_menu_aba === ‘function’ ) {

     func_menu_aba(id, id, '', '','', '../form_myform?id='+id, 'form');
    

    } else {
    window.open( ‘…/form_myform?id=’+id);
    }
    }

/script

<?php ====================================================================== 3. Add following code in event onrecord you can add any control you want and then you add your code. {edit} = "< a href=\"javascript:openmyform('".{id}."');\" class=\"scGridFieldOddLink\" >< img src='../_lib/img/scriptcase__NM__nm_ScriptCase6_Cromo_bform_editar.gif'>< /img >< /a >";
1 Like

thanks I will try it all.