You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
Table enhances the HTML <table> in one of two ways (implemented as extensions):
reflow
On narrow screens, columns in a row become rows in a single column, and each row has a row header based on the column header
columntoggle
Columns have associated priorities, and are turned off in order of priority depending on how narrow the screen is. They can also be turned on/off manually by unchecking checkboxes in a popup menu listing the columns. Once a column has been turned on/off by the user by clicking on a checkbox, or programmatically by setting a checkbox's ```checked``` property, the column will remain hidden if the checkbox is unchecked, and shown if the checkbox is checked, irrespective of screen width
Responsive Design Considerations
Breakpoints need to be provided for the automatic showing/hiding of columns to work. Alternatively, built-in breakpoints can be used. They apply whenever the class ui-responsive is added to the table.
Performance Considerations
It may be possible to
refresh the table in batches using idle loop
detach the table during creation
Accessibility Considerations
Navigation Considerations
Options
classes
Hash containing classes used by the table. Recognized keys:
table
Default value: "ui-table". This class is appended to the <table> element upon widget instantiation.
reflowTable
Default value: "ui-table-reflow". This class is appended to the <table> element upon widget instantiation when it is to be turned into a reflow table. This key is provided by the widget's reflow extension.
cellLabels
Default value: "ui-table-cell-label. This class is added to the <b> elements which play the role of headings when the is rendered as a single column on narrow screens. This key is provided by the widget's reflow extension.
popup
Default value: "ui-table-columntoggle-popup". This class is added to the popup containing the column checklist. This key is provided by the widget's columntoggle extension.
columnBtn
Default value: "ui-table-columntoggle-btn". This class is added to the button that brings up the column checklist. This key is provided by the widget's columntoggle extension.
priorityPrefix
Default value: "ui-table-priority-". The table constructs a class name from this prefix by appending the value of the data-priority attribute it finds on the column header, if any. It then applies the resulting class to all cells under the column header. This key is provided by the widget's columntoggle extension.
columnToggleTable
Default value: "ui-table-columntoggle". This class is appended to the <table> upon widget instantiation when it is to be turned into a columntoggle table. This key is provided by the widget's columntoggle extension.
columnButton
Default: true. Boolean option indicating that the widget is to generate a button that displays the columns popup when true.
columnBtnText
Default: "Columns...". The text to be used for the columns button.
columnBtnTheme
Default: null. The theme swatch to be used for the column button. The button inherits the swatch by default.
columnPopupTheme
Default: null. The theme swatch to be used for the column popup. The popup inherits the swatch by default.
columnUI
Default: true. Boolean option indicating that the widget is to generate a button and a popup such that the popup displays the columns available for showing/hiding, and the button launches the popup. If this option is ```false```, no button will be generated, even if the ```columnButton``` option is ```true```.
disabled
Default: false. Indicates that the table is disabled. This applies the ui-state-disabled class, but does not prevent the user from reaching content inside the table via the keyboard. In the case of the columntoggle table, it disables the column chooser button and popup.
enhanced
Default: false. Boolean option indicating that the user has provided all necessary markup a priori. In the case of the columntoggle table, this means that the "Columns..." button, the popup that opens from it, and all the checkbox inputs inside the popup have been provided.
mode
A string that can have one of two values:
"reflow"
Indicates that the table is to be enhanced as a reflow table
"columntoggle"
Indicates that the table is to be enhanced as a columntoggle table
Events
create notifies of the creation of a table widget on event target element
// bind to the create event
$( ".selector" ).on("tablecreate", function(event, ui) {});
// create a table on .selector and hook up to tablecreate event
$( ".selector" ).table({
create: function(event, ui) { }
});
Methods
destroy removes table enhancements from the element
$( ".selector" ).table( "destroy" );
enable enables the table
$( ".selector" ).table( "enable" );
disable disabled the table
$( ".selector" ).table( "disable" );
refresh re-examines the DOM ensuring the table widget's state is consistent with the DOM contents
This method retains the forced-show/forced-hide status of columns
@gabrielschulhof I know you have not changed this from the current implementation but the classes option is not being used correctly here this should be a mapping of structural classes to theme classes where the theme classes can be overridden but structural classes are non optional as they are often required by the widget for normal operation. see https://github.com/jquery/jquery-ui/pull/790/files for how this should be implemented as an option.
Table Review
Description
Functional Specification
Table enhances the HTML
<table>
in one of two ways (implemented as extensions):Responsive Design Considerations
Breakpoints need to be provided for the automatic showing/hiding of columns to work. Alternatively, built-in breakpoints can be used. They apply whenever the class
ui-responsive
is added to the table.Performance Considerations
It may be possible to
Accessibility Considerations
Navigation Considerations
Options
table
"ui-table"
. This class is appended to the<table>
element upon widget instantiation.reflowTable
"ui-table-reflow"
. This class is appended to the<table>
element upon widget instantiation when it is to be turned into a reflow table. This key is provided by the widget's reflow extension.cellLabels
"ui-table-cell-label
. This class is added to the<b>
elements which play the role of headings when the is rendered as a single column on narrow screens. This key is provided by the widget's reflow extension.popup
"ui-table-columntoggle-popup"
. This class is added to the popup containing the column checklist. This key is provided by the widget's columntoggle extension.columnBtn
"ui-table-columntoggle-btn"
. This class is added to the button that brings up the column checklist. This key is provided by the widget's columntoggle extension.priorityPrefix
"ui-table-priority-"
. The table constructs a class name from this prefix by appending the value of thedata-priority
attribute it finds on the column header, if any. It then applies the resulting class to all cells under the column header. This key is provided by the widget's columntoggle extension.columnToggleTable
"ui-table-columntoggle"
. This class is appended to the<table>
upon widget instantiation when it is to be turned into a columntoggle table. This key is provided by the widget's columntoggle extension.true
. Boolean option indicating that the widget is to generate a button that displays the columns popup when true."Columns..."
. The text to be used for the columns button.null
. The theme swatch to be used for the column button. The button inherits the swatch by default.null
. The theme swatch to be used for the column popup. The popup inherits the swatch by default.true
. Boolean option indicating that the widget is to generate a button and a popup such that the popup displays the columns available for showing/hiding, and the button launches the popup. If this option is ```false```, no button will be generated, even if the ```columnButton``` option is ```true```.false
. Indicates that the table is disabled. This applies the ui-state-disabled class, but does not prevent the user from reaching content inside the table via the keyboard. In the case of the columntoggle table, it disables the column chooser button and popup.false
. Boolean option indicating that the user has provided all necessary markup a priori. In the case of the columntoggle table, this means that the "Columns..." button, the popup that opens from it, and all the checkbox inputs inside the popup have been provided.Events
create notifies of the creation of a table widget on event target element
Methods
destroy removes table enhancements from the element
enable enables the table
disable disabled the table
refresh re-examines the DOM ensuring the table widget's state is consistent with the DOM contents
This method retains the forced-show/forced-hide status of columns
toggleColumn forces visibility for a column
column is either a number or a jQuery collection object containing at least one cell from the column to be forced hidden/shown
Markup & Style
Initial Markup
Enhanced Markup
CSS
Checklist
_setOptions()
with all options dynamically settable_destroy()
widget()
document
andwindow
directly - usesthis.document
andthis.window
The text was updated successfully, but these errors were encountered: