opened 02:07PM - 18 Oct 23 UTC
type: bug
tag: regression
tag: component: bokehjs
### Expected behavior
My expectation is, that all `autosize_mode`s of the `Da…taTable` can be displayed without an error.
### Observed behavior
The two modes `"fit_viewport"` and `"fit_columns"` both raise a `ReferenceError` shown in the Browser Console.
```
VM188 bokeh-tables-3.3.0.min.js:92
Uncaught (in promise) ReferenceError: row is not defined
at getColContentSize (VM188 bokeh-tables-3.3.0.min.js:92:48514)
at getColAutosizeWidth (VM188 bokeh-tables-3.3.0.min.js:92:47153)
at SlickGrid.autosizeColumns (VM188 bokeh-tables-3.3.0.min.js:92:44466)
at M.updateLayout (VM188 bokeh-tables-3.3.0.min.js:55:3085)
at M._after_render (VM188 bokeh-tables-3.3.0.min.js:55:6623)
at M.after_render (VM185 bokeh-3.3.0.min.js:560:6522)
at M.r_after_render (VM185 bokeh-3.3.0.min.js:560:6487)
at M.render_to (VM185 bokeh-3.3.0.min.js:560:6323)
at VM185 bokeh-3.3.0.min.js:218:834
at async u (bokeh-3.3.0.min.js:218:657)
```
### Example code
```Python
from datetime import date
from random import randint
from bokeh.models import ColumnDataSource, DataTable, DateFormatter, TableColumn
from bokeh.io import show, output_notebook
output_notebook()
data = dict(
dates=[date(2023, 3, i+1) for i in range(3)],
downloads=[randint(0, 100) for i in range(3)],
)
source = ColumnDataSource(data)
columns = [
TableColumn(field="dates", title="Date", formatter=DateFormatter()),
TableColumn(field="downloads", title="Downloads"),
]
data_table_viewport = DataTable(
source=source,
columns=columns,
width=400,
height=100,
autosize_mode = "fit_viewport", # same for "fit_columns"
)
show(data_table_viewport)
```
<details>
<summary>Software versions</summary>
Python version : 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0]
IPython version : 8.14.0
Tornado version : 6.3.2
Bokeh version : 3.3.0
BokehJS static path : /opt/conda/envs/aiva-env/lib/python3.10/site-packages/bokeh/server/static
node.js version : v18.16.0
npm version : 9.5.1
Operating system : Linux-4.19.0-21-amd64-x86_64-with-glibc2.35
Chrome Version 118.0.5993.71
</details>