Ramblin
Ramblin

Reputation: 181

sugarcrm 6.5 set number columns to 3 in one tab/panel, 2 in other tabs

I know how to set the columns in a detailview to 3 columns instead of the default 2 by putting into detailviewdefs.php

(in modules/EvMgr_Pgm/metadata if creating a custom module

or in custom/modules/EvMgr_Pgm/metadata if editing an existing module)

'maxColumns' => '3',
'widths' => 
array (
  0 => 
  array (
    'label' => '8',
    'field' => '19',
  ),
  1 => 
  array (
    'label' => '8',
    'field' => '19',
  ),
  2 => 
  array (
    'label' => '8',
    'field' => '19',
  ),
),

However, that sets the columns for ALL the tabs/panels in a detailview

Is there a way I can have there be 3 columns in one tab/panel and 2 columns (default) in the other tabs/panels?

Upvotes: 2

Views: 1265

Answers (1)

egg
egg

Reputation: 1756

If you change the widths to exceed 100 it'll recalculate the widths for a panel/table that has 3 or more columns. Try this:

'maxColumns' => '3',
'widths' => 
array (
  0 => 
  array (
    'label' => '10',
    'field' => '30',
  ),
  1 => 
  array (
    'label' => '10',
    'field' => '30',
  ),
  2 => 
  array (
    'label' => '10',
    'field' => '30',
  ),
),

This uses the standard 2 column 10/30 width. When a panel is created with 3 columns it'll recalculate the widths since it is greater than 100. At least as of 6.5.18 it does. Most likely it does for previous versions as well.

Upvotes: 1

Related Questions