1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-01 13:24:10 +01:00
Commit Graph

1061 Commits

Author SHA1 Message Date
Allan Jardine
e7b656d3f2 Added new tests for callbacks, first pass complete.
(will need to add more tests for stateLoad/save)
2016-08-09 17:55:50 +01:00
Allan Jardine
269bf01da0 Fix: Improve column selector when used with a complex jQuery selector for pseudo selectors
- Many thanks to chrisaeg for pointing this out!
2016-08-09 17:55:19 +01:00
Allan Jardine
15baf23757 Dev: Revert 6f6b3d4b14fbba4a8818d8a24dc71763f9e92c80 - it was completely wrong! 2016-08-09 17:52:59 +01:00
Allan Jardine
dfd7241083 Dev: Correct internal parameter names - they we misleading in the code 2016-08-09 17:51:07 +01:00
Allan Jardine
66e1e89ed7 Merge branch 'master' of https://github.com/DataTables/DataTablesSrc 2016-08-09 17:48:56 +01:00
Allan Jardine
429b623190 Added new test
Callbacks- createRow.js
2016-08-09 17:48:40 +01:00
Allan Jardine
00682a585e Merge pull request #80 from aij/master
Fix: When sorting a date column, an empty string would be incorrectly used as 1970-01-01.
2016-08-09 17:47:52 +01:00
Allan Jardine
50d14fc06c Added new tests for columns options.
Includes-

columns.orderable
columns.className
columns.name
columns.orderData
columns.searchable
columns.title
columns.visible
columns.width
2016-08-09 17:47:19 +01:00
Allan Jardine
df8192e3be Fix date sorting of empty fields
Previously, date sorting of values that
failed to parse as a date were sorted as
if they were 1970-01-01 (Unix and JS epoch).

Now, they sort before other dates.

Example:
https://jsfiddle.net/qae6zjty/1/
2016-08-09 17:47:03 +01:00
Allan Jardine
3a432c5db3 DataTables 1.10.12! 2016-05-20 14:09:02 +01:00
Allan Jardine
e25a106ecc New: $.fn.dataTable.util methods are now overridable (throttle and escapeRegex)
- It is useful to be able to replace some of the utility methods with
  your own custom ones - for example a debounce rather than tha throttle
  for filtering.
- This commit reorders the code a little to make that possible. No new
  code is present at such - its really about reordering the current code
  to make `$.fn.dataTable.util` the host for the original functions.
  Backwards compatiblity is provided by assigning the util methods to
  their old variables. With the next major update they should be removed
  and the util methods used directly.
- Other util methods should be added at the same time, escapeHtml,
  unique, etc.
- Fixes DataTables/DataTables #810
2016-05-09 15:25:20 +01:00
Allan Jardine
26cbeccba1 Fix - example: Server-side pipelining didn't work when all data is requested
- Although this mitigates any benefits of using server-side processing
  it is something that should be handled.
- Thanks Hormah for pointing this out.
2016-05-02 16:15:12 +01:00
Allan Jardine
73abf82c1d Fix: dt-api order() called with an empty array would cause a JS error
- Fixes DataTables/DataTables #800
- Its safe to check for `.length` on `orders` at this point since it can
  be either a number, an array or undefined. The number and undefined
  conditions have already been checked, so it must be an array (of
  whatever length).
2016-04-19 17:51:22 +01:00
Allan Jardine
e6d8429987 Dev: Fix recursion error with Responsive from last commit. Need to be
more selective about when we fire `column-visiblity`!
2016-04-19 17:50:49 +01:00
Allan Jardine
938289db93 Dev: A JS error was introduced with the column visiblity change - undefined variable.
- Need to use two iterators for the columns visible unfortunately
2016-04-19 17:49:39 +01:00
Allan Jardine
1749cb2b1b Fix: Performance issue when using columns.visible() as a setter.
The column resize was being called for every column.
2016-04-18 15:09:38 +01:00
Allan Jardine
c6e574314b Fix - docs: Add dt-init lengthChange to dt-init dom related 2016-04-18 15:00:55 +01:00
Allan Jardine
e350e155d2 Fix: Column visiblity count was only correct if the table was actually visble itself. We want to be able to count columns even when the table is not visible.
- Thread 33203
2016-02-15 15:14:16 +00:00
Allan Jardine
45ed4f3973 Dev: Version bump 2016-02-15 15:13:38 +00:00
Allan Jardine
d0163e24a0 DataTables 1.10.11 release 2016-02-11 14:30:12 +00:00
Allan Jardine
fa5dc0f900 Dev: Update to include the latest jQuery in the repo 2016-02-11 14:29:35 +00:00
Allan Jardine
b69ccaeb6c Adding new integration files from the source repo. These are all currently proof of concept / technical previews and not ready for production use. 2016-02-11 10:28:13 +00:00
Allan Jardine
cf37b3bcfc Fix: Visible column count should take account of display:none columns as well as those removed from the DOM by DataTables core. This improves compatiblity with Responsive 2. 2016-02-10 15:05:41 +00:00
Allan Jardine
4ce6614977 Fix: Clear the cached data setter for DOM sourced tables when setting column options. This fixes issues with ColReorder and DOM sourced tables
- Fixes DataTables/ColReorder #50.
2016-02-09 15:29:26 +00:00
Allan Jardine
f734cdb672 Dev: Add example ordering information for FixedColumns
- Really must make some dynamic logic for this...
2016-02-05 12:15:50 +00:00
Allan Jardine
bc5adb493c Initial integration work for the uikit framework.
Updated the mit license with a comment on additional author Google Inc.
2016-02-05 12:15:16 +00:00
Allan Jardine
c0f3242d0d Dev: Remove trailing comma 2016-02-04 15:46:23 +00:00
Allan Jardine
e253006207 New: Greatly improve the utility of the row, column and cell selectors:
* `dt-api rows()` and `dt-api row()` can now be used with a cell from
    the table body (not limited to only the `tr` elements
  * `dt-api columns()` and `dt-api column()` can now be used with a cell
    from the table body (not just the column headers as before)
  * All three selector types can use an element with the `data-dt-row`
    and / or `data-dt-column` (as approrirate) attributes on them or a
    parent. This is useful for API integration with FixedColumns and
    Responsive. For example you can now pass a cell in a fixed column
    into the `dt-api cell()` method to select the original cell.
2016-02-04 14:44:38 +00:00
Allan Jardine
61fdeb0b9b Fix: When using data-* attributes for orthogonal data with a DOM sourced table, don't write to the DOM if the data hasn't changed.
- Fixes DataTables/DataTables #684
2016-02-03 15:40:44 +00:00
Allan Jardine
ff3bccad58 Fix: Checked radio boxes could be incorrectly unchecked if autowidth was enabled (which it is by default)
- Fix is to remove the name attribute. This would have no effect on the
  column width and means the radio element isn't in a group.
- See thread 32931
- Fixes DataTables/DataTables #569
2016-02-03 11:44:24 +00:00
Allan Jardine
c4986625c8 Fix: Improved DOM ordering for scrolling tables - colgroup, thead, tfoot
- Fixes DataTables/FixedColumns #8
2016-02-03 11:43:48 +00:00
Allan Jardine
386150893a Fix: Javascript error would occur if trying to use dt-api cells().nodes() on a cell that doesn't exisit in the DataTable
- Fixes DataTables/KeyTable #23.
2016-02-03 11:41:22 +00:00
Allan Jardine
f8e2c9928d Fix: Remove legacy TableTools integration from Bootstrap file 2016-02-03 11:39:57 +00:00
Allan Jardine
aec81fd557 Fix - styling: Integration with Foundation 6
- F6 changes the paging control (for the better) to require that there
  be no `a` tag for the elements which can't be clicked on in the pager.
  Unforuntately F5 requires them, so we need to detect which one is to
  be used. This is done using a meta tag based on this discussion:
    - http://foundation.zurb.com/forum/posts/36681

- F5 remains the main version for the moment, but will be bumped to F6
  when the next version of DataTables is released
2016-01-22 11:24:53 +00:00
Allan Jardine
af95119318 Dev: Version bump to dev 2016-01-07 15:33:02 +00:00
Allan Jardine
9563278a4a Fix: Potential column misalignment when scrolling with footer content that defines the width
- The scrolling body used to have the header content retained but
  hidden, while the footer was just emptied. But if the footer content
  is long enough to define the width of the column this results in
  column misalignment.
- Fix is to treat the footer in the same way as the header is.
2016-01-07 15:32:39 +00:00
Allan Jardine
f3fc3cd64e Fix: Remove redundant code in column visibility. Could cause slower performance
- Thanks sameeralikhan - thread 32212
2016-01-07 15:28:39 +00:00
Allan Jardine
344565a03d Fix: Column widths are not only applied to the DataTables detected headers when scrolling is activated. This will have no change on most tables, but for those with complex headers it prevents potentially contradictory sizes being applied which can result in column misalignment. 2016-01-07 15:28:13 +00:00
Allan Jardine
6c9c5433eb Fix: dt-api cell().data() would not return null values for cells if defaultContent was set. It should return the original data point for that cell, even if it is null. This also effects dt-api column().data() and their plural counterparts. 2016-01-07 15:26:52 +00:00
Allan Jardine
b7c671444d Fix: The number rendering helper will now automatically escape HTML entities to help prevent possible XSS attacks if using a number renderer.
Rational for this is that the number renderer expects a number
input, not HTML, but if non-numeric input is given the value is just
returned (now escaped) - for example an empty string.
2016-01-07 15:24:53 +00:00
Allan Jardine
e245645544 Version - 1.10.10 ready 2015-11-06 15:34:24 +00:00
Allan Jardine
c4f9792c07 Dev: Remove debug line 2015-11-06 14:39:04 +00:00
Allan Jardine
6f67df2d21 New: $.fn.dataTable.render.text renderer method that can be used to help prevent against possible XSS attacks. It will basically encode HTML entities so they are shown in the rendered view rather than being written directly as HTML.
Update: `$.fn.dataTable.render.number` will now return the original value rather than NaN if the value cannot be parsed as a number.
2015-11-06 10:40:50 +00:00
Allan Jardine
06a6a0c429 Dev: Add a plugin-init event which is triggered immediately prior to init
- This is so that Buttons (and others) can listen for this event and
  create the buttons before the user init functions. Otherwise they
  would need a setTimeoutout to be able to access the Buttons methods
  immediately.
2015-11-04 16:33:00 +00:00
Allan Jardine
b36cbc745b Update: Allow a window to be passed in for CommonJS factory which gives DataTables the ability to be used in a headless environment (server-side rendering for example)
- Factory builder redesigned to pass in window and document to the
  factory method, mandating a small update to the AMD and Browser
  loaders
- Main change in is the CommonJS loader which can now optionally have a
  window object passed in - if it is not passed in `window` will be used
  (if this is the case in a CommonJS environment without a root object
  being passed in an error will occur).
- DataTables caches a reference to the jQuery instance so the plug-ins
  can easily reference jQuery while retaining their current return of
  the module they define. This basically means that DataTables core will
  include jQuery for the plug-ins.
- This does increase the core library size by ~160 bytes which is rather
  frustrating, but I think this is the correct way to go about it
- With thanks to Evan Carroll for input on this:
  https://github.com/DataTables/Plugins/issues/199
2015-11-03 16:32:39 +00:00
Allan Jardine
8fe17acf82 Update: A dt-init scrollX table is now allowed to collapse horizontally - simply don't specify style="width: 100%" or width="100%" for your table in the HTML and it will be allowed to collapse if the columns are smaller than the space required.
Fix: Force a column width if `dt-init scrollX` is specified and a column width is given. This can be overruled if the width given is too small for the content

- We already use the width attribute to determine if the table should
  resize dynamically to 100% width, so it makes sense to use that when
  scroll-x is enabled as well.
- This still isn't perfect as Chrome seems to change between a
  box-sizing calculation depending if scrolling is required or not so
  there can be a shift in column widths when changing between a
  scrolling state and not (column visibility) which is ugly, but is
  proving to be difficult to deal with.
2015-11-03 16:32:10 +00:00
Allan Jardine
ab982a537e New: dt-init language.aria.paginate options which can be used to specify ARIA label attributes for the pagination buttons. Particularly useful if you wish to use icons in place of the button text. 2015-10-28 11:38:01 +00:00
Allan Jardine
b9bdc5eb11 Fix: dt-api page.info() reported the page length as 10 when paging was disabled - should be -1 2015-10-28 09:03:41 +00:00
Allan Jardine
66893ae170 Update: Add column index information to the Requested unknown parameter error message to provide additional debug info 2015-10-28 09:03:15 +00:00
Allan Jardine
8adcf16743 Fix: Column alignment errors in IE due to sub-pixel rendering issues. Basically this came down to the width of the table not equalling the width of the cells in the table and if the column widths assigned and the table width assigned did not match perfectly, IE would ignore the column widths assigning and layout as it saw best. Now the column width calculation will remove this sub-pixel issue by rounding up and also keep a track of the table width itself rather than reading from the DOM.
Fix: ` ` in cells could cause column alignment errors as it was being counted as 6 characters rather than 1 in the find longest string method.
2015-10-27 12:05:03 +00:00