Skip to content

Commit

Permalink
Fix Tabulator sorting and data initialization (#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 12, 2021
1 parent e8f3324 commit fb73018
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions panel/models/tabulator.ts
Expand Up @@ -167,19 +167,20 @@ export class DataTabulatorView extends PanelHTMLBoxView {
cellEdited: (cell: any) => this.cellEdited(cell),
columns: this.getColumns(),
layout: this.getLayout(),
ajaxSorting: true,
pagination: pagination,
paginationSize: this.model.page_size,
paginationInitialPage: 1,
}
if (pagination)
if (pagination) {
configuration['ajaxURL'] = "http://panel.pyviz.org"
configuration['ajaxSorting'] = true
}
const cds: any = this.model.source;
let data: any[]
if (cds === null || (cds.columns().length === 0))
data = transform_cds_to_records(cds, true)
else
data = []
else
data = transform_cds_to_records(cds, true)
return {
...configuration,
"data": data,
Expand Down

0 comments on commit fb73018

Please sign in to comment.