Greetings. Happy New Year!
I noticed a problem with the paginationSizeSelector which is a tabulator configuration when working with “remote” data. It works successfully with “local” data.
Here is a minimum working example that shows the issue…
import panel as pn
import pandas as pd
import numpy as np
layout = pn.Column()
# Generate FeedbackIDs from 3001 to 3035
feedback_ids = np.arange(3001, 3001 + 35)
# List of sample customer names
customer_names = [
"Alice", "Bob", "Charlie", "Diana", "Ethan",
"Fiona", "George", "Hannah", "Ian", "Julia",
"Kevin", "Laura", "Michael", "Nina", "Oliver",
"Paula", "Quentin", "Rachel", "Steven", "Tina",
"Uma", "Victor", "Wendy", "Xander", "Yvonne",
"Zach", "Amy", "Brian", "Catherine", "Daniel",
"Ella", "Frank", "Grace", "Henry", "Isla"
]
# Generate random ratings between 1 and 5
ratings = np.random.randint(1, 6, size=35)
# Create the DataFrame
df = pd.DataFrame({
'FeedbackID': feedback_ids,
'CustomerName': customer_names,
'Rating': ratings
})
df_widget_local = pn.widgets.Tabulator(df, pagination='local', page_size=2, configuration={'paginationSizeSelector': [2, 10, 25]})
df_widget_remote = pn.widgets.Tabulator(df, pagination='remote', page_size=2, configuration={'paginationSizeSelector': [2, 10, 25]})
layout.append(pn.Row(df_widget_local, df_widget_remote))
layout.servable()
Saw this code in Tabulator python code related to page_size, but the parameter is never passed and I couldn’t figure out how the events are invoked between the front end and the backend for changing pages as an example, to then try to discover where the page_size might be needing to be invoked.
Thanks!
Pete