tablescript
v0.0.20
Published
create tables based on objects and classes
Readme
TableScript API Documentation
Introduction
⚠ Warning: This library is still in development and should not be used by users outside the development team.
TableScript is a JavaScript library designed for handling dynamic tables in web applications. This documentation covers the main class TableScript, its methods, and configuration options.
Class: TableScript
Constructor
new TableScript(id)- id (string): The ID of the HTML table element.
- Returns: An instance of
TableScript.
Methods
setFilters(filters)
table.setFilters(filters)- filters (Array): List of filters to be applied to the table.
- Returns: The
TableScriptinstance (for chaining).
setRS(RS)
table.setRS(RS)- RS (any): Data source or remote service handling the table's content.
- Returns: The
TableScriptinstance.
setHeaderActions(headerActions)
table.setHeaderActions(headerActions)- headerActions (Array): Defines actions available in the table header.
- Returns: The
TableScriptinstance.
setActions(actions)
table.setActions(actions)- actions (Array): Defines actions available for table rows.
- Returns: The
TableScriptinstance.
Usage Example
const table = new TableScript("myTable")
.setFilters([{ column: 'name', value: 'John' }])
.setRS('/api/data')
.setHeaderActions([{ name: 'Export', action: exportFunction }])
.setActions([{ name: 'Delete', action: deleteFunction }]);Notes
- TableScript instances are stored globally in
window.tables. - Supports method chaining for easier configuration.
Future Enhancements
- Improved filtering capabilities.
- Pagination options.
- Column sorting enhancements.
This documentation will be updated as the library evolves.
