Skip to content

Commit

Permalink
handle title_formatter if is type dict (#6166)
Browse files Browse the repository at this point in the history
Co-authored-by: Jenny Zhang <[email protected]>
  • Loading branch information
2 people authored and philippjfr committed Jan 17, 2024
1 parent 0ea55dc commit 3fc7e36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions panel/widgets/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1814,10 +1814,10 @@ def _config_columns(self, column_objs: List[TableColumn]) -> List[Dict[str, Any]
col_dict['formatter'] = formatter.pop('type')
col_dict['formatterParams'] = formatter
title_formatter = self.title_formatters.get(field)
if title_formatter:
if isinstance(title_formatter, str):
col_dict['titleFormatter'] = title_formatter
elif isinstance(title_formatter, dict):
formatter = dict(title_formatter)
title_formatter = dict(title_formatter)
col_dict['titleFormatter'] = title_formatter.pop('type')
col_dict['titleFormatterParams'] = title_formatter
col_name = self._renamed_cols[field]
Expand Down

0 comments on commit 3fc7e36

Please sign in to comment.