This is a complete re-write of the plugin. There is no upgrade path from V2 to V3 at present as the options and the way the code is written are inherently different. Please check out the full documentation for V3 found in the docs folder or by viewing it online here.
Pull requests need to be made against the develop branch as a new feature. I've switched to using a GitFlow process with this repository to try keep things organized a bit more. It makes it easier for me to test and make changes to submitted pull requests before merging the feature into the develop branch. The master branch now only contains release versions of the code.
expanded.ft.row
and collapsed.ft.row
that occur after there complementary expand.ft.row
and collapse.ft.row
events.FooTable.Export
component which exposes two primary methods on the FooTable.Table
object, .toJSON()
and .toCSV()
.array
column type to make rendering JavaScript arrays as cell contents easier.object
column type to make rendering JavaScript objects containing multiple properties as cell contents easier.container
option to the filtering component. This option allows you to provide a selector to specify where the filtering form is rendered. The selector should match only a single element and if multiple are found only the first is used.container
option to the paging component. This option allows you to provide a selector to specify where the paging UI is rendered. The selector should match only a single element and if multiple are found only the first is used.redrawSelf
as an extra parameter to the FooTable.Cell#val(value, redraw, redrawSelf)
and FooTable.Row#val(value, redraw, redrawSelf)
methods. This parameter dictates whether the row or cell updates its' own DOM when a value is set.FooTable.Paging#pageSize
method to also accept string values. If the parameter is not supplied or is not a valid number the current page size is returned.FooTable.Filtering#filter
method to accept a single boolean param simply called focus
, if supplied and true the default search input receives focus after the component performs a filter operation. This new param is used internally when auto applying a query after a user types in the search input, or clicks the search/clear buttons. This behavior can be disabled by setting the new filtering.focus
option to false
..formatter()
function of all column types to now accept three parameters; value
, options
and rowData
. value
and options
have always been available, the new addition is the rowData
parameter which is an object containing the current rows' parsed values, the properties of this object match the names of the columns for the current table, if no names are specified the properties will be col1
, col2
, etc.FooTable.HTMLColumn#sortValue
method to offload additional parsing to its .parser()
method.FooTable.NumberColumn
where it was converting negative numbers to positive when parsing values directly from the DOM.FooTable.Table#_construct
method which was not returning a promise as it should have been doing.FooTable.Table#draw
method to prevent unnecessary browser reflows and hide an unstyled flash of content during the initial loading of the table. (@jleider & @mrdziuban)FooTable.DateColumn#formatter
method to perform a check for invalid dates and return an empty string instead of "Invalid Date"
. (@jnimety)FooTable.Cell#collapse
method to copy all attributes from the original element to the one displayed in the details row. If the element has an ID, the copied version is suffixed with "-detail"
to avoid duplicates. (@mrdziuban)FooTable.Column#parser
method to use jQuery's .html()
method instead of .text()
as the latter was decoding HTML entities which were then reinserted into the DOM which opened up the possibility of XSS.FooTable.Paging#_countFormat
private method and replaced it with a new FooTable.Paging#format( string )
method to make custom paging UI's simpler to implement.TH
element.dropdownTitle
option to the filtering component. This options specifies a title to display at the top of the column select dropdown.exactMatch
option to the filtering component.FooTable.str.containsExact(string, match, ignoreCase)
.footable-filtering-search
to the form-group
of the built in search input for the filtering component.footable-first-visible
and footable-last-visible
classes to all cells (including headers) in either the first or last visible columns respectively.min
option default value from 3
to 1
for the filtering component.FooTable.Query
object where phrases were not being matched correctly.sortValue
and filterValue
attributes contained a falsy value. The values are now subject to a strict undefined check before being passed off.date
column type not sorting it's values as expected.sortValue
column option. This option allows you to supply your own function to retrieve the sort value for a cell.FooTable.Filtering#addFilter
method to accept an object or FooTable.Filter
as the first argument to make custom filters easier to implement.preinit
and init
to return a promise to make custom filters easier to implement.FooTable.Filter
to accept a FooTable.Query
as the query parameter along with the original plain string.min
option was not being applied.countFormat
option placeholder {TR}
to correctly reflect filtered rows.table
the plugin is initialized on has no class
attribute.footable.core.bootstrap.min.css
and footable.core.standalone.min.css
minified files.breakpoint
class to the table when columns are hidden.hidden
option that can be used for filters. When set to true the filter is always applied to the table, can not be cleared unless removed using the FooTable.Filtering#removeFilter()
method and they will not effect the default UI search/clear buttons.FooTable.Filtering#addFilter()
method to expose the last three parameters of the FooTable.Filter
constructor; ignoreCase, connectors and space.FooTable.Filtering#draw()
method was not setting the button to the clear icon if the filter supplied was not the default.sorted=true
without supplying a direction.FooTable.Rows#expand()
and FooTable.Rows#collapse()
methods to toggle all visible rows.FooTable.getRow()
utility method to retrieve the current FooTable.Row
object given a TR
element or any of its' children.FooTable.Component
method signatures.FooTable.Row#val()
method to merge supplied data instead of replacing it entirely.FooTable.getFnPointer()
method to handle dot notation names.data-breakpoints
attribute is no longer required.FooTable.Filtering#filter()
method to only apply all filters in the FooTable.Filtering#filters
.FooTable.Table#applyFilter()
and FooTable.Table#removeFilter()
methods.FooTable.components.core
and FooTable.components.internal
objects.NOTE
As of version 3.1.0 there are some backwards compatibility issues if you have done customizations like those seen in the custom dropdown filter example using the 3.0.x versions. The examples have been updated with the changes however the issues are listed below.
FooTable.Filtering#filter()
method no longer accepts any arguments and is used purely to apply all filters found in the FooTable.Filtering#filters
array.FooTable.Filtering#addFilter(name, query, columns)
method using a name of "search".FooTable.Table#components
object have been removed. All components are now loaded into a single array.FooTable.components.register()
method instead of having to decide between FooTable.components.register()
, FooTable.components.core.register()
and FooTable.components.internal.register()
due to #3 above.FooTable.Rows#load()
method to make supplying the table with new data much easier.FooTable.Rows#add()
,FooTable.Rows#update()
and FooTable.Rows#delete()
methods to allow for better bulk operations.expand.ft.row
and collapse.ft.row
were not supplying the row as a parameter.FooTable.init()
constructor.FooTable.NumberColumn#thousandSeparator
was being initialized with an incorrect default value.ready.ft.table
and postinit.ft.table
events.FooTable.Table#_construct()
method to allow for easier overriding.FooTable.Sorting#toggleAllowed(state)
, FooTable.Sorting#hasChanged()
and FooTable.Sorting#reset()
.indexOrRow
parameter for the FooTable.Row#delete()
and FooTable.Row#update()
methods was being ignored.toggleSelector
to allow filtering of row click events.expand.ft.row
and collapse.ft.row
.FooTable.Table
.TH
elements being overridden by Bootstrap.