Readonly filed on List View

Hi all Developers,

i want to apply readonly field on list view. 
i already explored dependencies and verdef concept and i have achieved it but here i need to apply readonly on list view
 so, please let us know how i can do readonly field on list view

Any suggestions would be appreciated.....

Thanks

 

Parents
  • The easiest way to apply readonly only to a single view is to edit the view's definition.

    So in your 

    custom/modules/<module>/clients/base/views/list/list.php

    find the filed in question, and add: 

    'readonly'=>true

    as one of the properties.

    For example, you can see in the stock Accounts list view, the date_entered is read only.

    This particular field happens to be readonly in all the views but there is nothing stopping you from setting it only on the list.php and not the record, create. preview etc.

                    array (
                        'name' => 'date_entered',
                        'type' => 'datetime',
                        'label' => 'LBL_DATE_ENTERED',
                        'enabled' => true,
                        'default' => true,
                        'readonly' => true,
                    ),
    

    If, on the contrary, you want the field to be readonly across all views, you should do that via Studio:

      

    FrancescaS

  • Thank you   i have applied the above approach, and it is working fine for me, but i need to apply on preview also, because it is still editable in preview mode,
    however you already mentioned that this is working on on list view.


    please note, my custom field type is TextField

Reply Children