AnsweredAssumed Answered

How to Change Edit View Form Field Widths? (NOT Detail View)

Question asked by Jeff C on Jan 8, 2015
Latest reply on Jan 8, 2015 by Jeff C
In detail view, I can easily add columns and adjust the label and field widths by editing the detailviewdefs.php in various modules.  However, changes the column parameters in editviewdefs.php does not have the same effect as the form field widths never change!  I've tried quick repair too.  

Specifically, my custom/modules/Accounts/metadata/editviewdefs.php has this in it.  The changes to the number of columns works but the field widths don't change (changed from 30 to 15.) 

If I look at the HTML source, the size setting for most of the text inputs is 30.   It seems to me what is happening is although you can edit the table (TD) width via the viewdef, SugarCRM still defaults the input text boxes to a size 30 (the default column width size of the table).  Ideally, I think it would be best to set the text input size to the same as the maxlength, this way you can easily control the text input width via the field maxlength definition via Studio instead of having to implement custom CSS.  

Barring something I've overlooked already in Sugar to control the input text fields width in a module edit view, I suppose I just need to find the point in the PHP display code that sets the input field size attribute and modify it to use the maxlength value.  

  'maxColumns' => '6',
         'widths' => 
         array (
           0 => 
           array (
             'label' => '10',
             'field' => '15',
           ),
           1 => 
           array (
             'label' => '10',
             'field' => '15',
           ),
     2 => 
           array (
             'label' => '10',
             'field' => '15',
           ),
           3 => 
           array (
             'label' => '10',
             'field' => '15',
           ),
     4 => 
           array (
             'label' => '10',
             'field' => '15',
           ),
           5 => 
           array (
             'label' => '10',
             'field' => '15',
           ),
         ),

Outcomes