- +
From fe33221de91587b33d3510556f3e839ef50a3fcb Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Tue, 13 May 2014 00:59:34 +0300 Subject: [PATCH 05/11] Table: Add option "enhanced" --- entries/table.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/table.xml b/entries/table.xml index e3ed6140..24e13f88 100644 --- a/entries/table.xml +++ b/entries/table.xml @@ -373,6 +373,7 @@ +
Rank
]]> -

Working with grouped column headers

+

Working with grouped column headers

It's fairly common to need to logically group multiple columns together under a heading group for financial or scientific data. The framework can support the most simple version of this by allowing for two rows of table headers (TH), with the first row containing simple colspan attributes to group the columns below. In this configuration, the framework will add a class to the label of the first cell in each group to allow you to style these differently and provide aditional visual hierarchy.

@@ -282,10 +282,6 @@

The theme for the column chooser popup can be set by adding the data-column-popup-theme attribute to the table and specifying any swatch letter in your theme. For custom styles or scripting, all the column chooser popups can be targeted by using the ui-table-columntoggle-popup structural class added to these popups. To customize a single popup, use the generated ID based on the table ID that added to each specific popup (such as #movie-table-popup) to target a specific popup.

-

Working with grouped column headers

- -

It's fairly common to need to logically group multiple columns together under a heading group for financial or scientific data. The framework can support the most simple version of this by allowing for two rows of table headers (TH), with the first row containing simple colspan attributes to group the columns below. In this configuration, the framework will parse the first row only for the priority and expose these heading groups as the options in the column chooser popup. In this configuration, the second heading will not be exposed as columns that can be hidden or shown independently of the groupings in the chooser.

-

The columntoggle table places an anchor before the table that invokes a popup listing the columns available for showing/hiding. The ID of the popup and thus the href of the anchor should be the ID of the table suffixed by the string -popup. The anchor must also have an id attribute which is identical to that of the table, but postfixed with -button. This will allow the table to correctly enable/disable when you modify its disabled option. You may separately pre-enhance the popup widget, or you may allow autoinitialization to enhance it.

The popup widget must contain a single controlgroup widget which in turn contains all the checkboxes representing the columns of the table.

@@ -342,6 +338,8 @@
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.
+
cellLabelsTop
+
Default value: "ui-table-cell-label-top. This class is added to the <b> elements which play the role of top level headings when the is rendered as a single column on narrow screens and it has grouped headers. 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
From 953e95d955180aa22ea7ea518a0be59f568e0b82 Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Tue, 27 May 2014 15:58:10 +0300 Subject: [PATCH 09/11] Table: Document new option columnButton --- entries/table.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/entries/table.xml b/entries/table.xml index 428477fd..4afcc6e4 100644 --- a/entries/table.xml +++ b/entries/table.xml @@ -355,13 +355,19 @@ Sets the text prompt for the column chooser button.

This option is also exposed as a data attribute:data-column-btn-text="Show columns".

- + + @@ -385,7 +389,7 @@
"reflow"
Indicates that the table should handle narrow screens using functionality provided by the reflow extension.
"columntoggle"
-
Indicate sthat the table should handle narrow screens using functionality provided by the columntoggle extension.
+
Indicates that the table should handle narrow screens using functionality provided by the columntoggle extension.

This option is also exposed as a data attribute: data-mode="columntoggle".

From 49771c91a755ef7bd1e1eafd15d03908476facac Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Wed, 28 May 2014 21:09:17 +0300 Subject: [PATCH 11/11] Table: Add classes "cellHidden" and "cellVisible" and method setColumnVisibility() --- entries/table.xml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/entries/table.xml b/entries/table.xml index 78689f94..2ace0cc9 100644 --- a/entries/table.xml +++ b/entries/table.xml @@ -340,14 +340,18 @@
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.
cellLabelsTop
Default value: "ui-table-cell-label-top. This class is added to the <b> elements which play the role of top level headings when the is rendered as a single column on narrow screens and it has grouped headers. 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 popup 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 popup extension.
+
cellHidden
+
Default value: "ui-table-cell-hidden". This class is added to all cells in a column that the user has forced into the hidden state by calling the toggleColumn() method or by unchecking a checkbox in the popup menu. This key is provided by the widget's columntoggle extension.
+
cellVisible
+
Default value: "ui-table-cell-visible". This class is added to all cells in a column that the user has forced into the visible state by calling the toggleColumn() method or by checking a checkbox in the popup menu. 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.
+
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 popup 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 popup extension.
@@ -417,6 +421,21 @@ 1.5.0 Re-process the entire table to ensure it is displayed correctly. + + Sets the visibility of a column. + + +

This argument may be set to either a number or a jQuery collection object.

+

When set to a number, the value of this argument is the zero-based DOM order index of the cell located in the table header's first row whose column's visibility is to be set.

+

When set to a jQuery collection object, the value of this argument is a jQuery collection object containing a cell from the column whose visibility is to be set. Only the first item in the collection object is used.

+
+ + +
+ + When true, it causes the column to be always shown. When false, it causes the column to be always hidden. + +
350