Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/tabulator-tables/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2862,7 +2862,7 @@ declare class Tabulator {
/** Destructor. */
destroy: () => void;

setData: (data: any, params?: any, config?: any) => Promise<void>;
setData: (data?: any, params?: any, config?: any) => Promise<void>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why's that necessary? any includes undefined.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out any (or unknown for that matter) is not the same as an optional parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add any, it was there before my PR. I just added ? to make the first parameter optional. However, ? will make the parameter optional and nullish, it has no relation with the data type.


/** You can remove all data from the table using clearData */
clearData: () => void;
Expand Down
15 changes: 15 additions & 0 deletions types/tabulator-tables/tabulator-tables-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1742,3 +1742,18 @@ table = new Tabulator("#example-table", {
},
],
});

table = new Tabulator("#example-table", {
height: "500px",
layout: "fitColumns",
ajaxURL: "https://jsonplaceholder.typicode.com/posts",
columns: [
{title: "ID", field: "id", width: 50},
{title: "User ID", field: "userId", width: 50},
{title: "Title", field: "title"},
{title: "Body", field: "body"},
]
});

table.setData(table.getAjaxUrl());
table.setData();