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 <11775234+jz314@users.noreply.github.com>
  • Loading branch information
jz314 and jz314 committed Jan 9, 2024
1 parent 6cbd6b4 commit 84c9923
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 84c9923

Please sign in to comment.