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

1619 Commits

Author SHA1 Message Date
Allan Jardine
7edd896e92 Merge branch 'master' of https://github.com/DataTables/DataTablesSrc 2016-12-02 17:41:42 +00:00
Allan Jardine
02e28fd14e Added new tests for callbacks, first pass complete.
(will need to add more tests for stateLoad/save)
2016-12-02 17:41:11 +00:00
Allan Jardine
3e88556062 Fix: Improve column selector when used with a complex jQuery selector for pseudo selectors
- Many thanks to chrisaeg for pointing this out!
2016-12-02 17:40:40 +00:00
Allan Jardine
530dd14e94 Dev: Revert 6f6b3d4b14fbba4a8818d8a24dc71763f9e92c80 - it was completely wrong! 2016-12-02 17:38:19 +00:00
Allan Jardine
5dcd176847 Dev: Correct internal parameter names - they we misleading in the code 2016-12-02 17:36:30 +00:00
Allan Jardine
e2dd3bef57 Merge branch 'master' of https://github.com/DataTables/DataTablesSrc 2016-12-02 17:34:24 +00:00
Allan Jardine
03d3f4edb9 Added new test
Callbacks- createRow.js
2016-12-02 17:34:08 +00:00
Allan Jardine
da861f3604 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-12-02 17:33:21 +00:00
Allan Jardine
75556f9eca Added new tests for columns options.
Includes-

columns.orderable
columns.className
columns.name
columns.orderData
columns.searchable
columns.title
columns.visible
columns.width
2016-12-02 17:32:49 +00:00
Allan Jardine
42ae4bf0c5 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-12-02 17:32:32 +00:00
Allan Jardine
8d662b2229 DataTables 1.10.12! 2016-12-02 17:22:55 +00:00
Allan Jardine
635aad30cc Fix: Align "show entries" text correctly for cases where the Semantic UI JS is not available on the page 2016-12-02 17:22:39 +00:00
Allan Jardine
4865de6399 Fix: Semantic UI styling with a scrolling table 2016-12-02 17:22:08 +00:00
Allan Jardine
63f8c2d9ae Dev: Apply previous fix to Bootstrap 4 as well 2016-12-02 17:21:52 +00:00
Allan Jardine
d014c19992 Fix: Apply border-collapse: separate to Bootstrap styled DataTables
- Previously it was only used for tables which were marked with the
  `table-bordered`, but that caused issues with scrolling tables which
  are borderless.
- See DataTables/FixedColumns #57
2016-12-02 17:21:37 +00:00
Allan Jardine
632f449467 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-12-02 17:20:34 +00:00
Allan Jardine
61ab42e4b2 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-12-02 17:19:00 +00:00
Allan Jardine
452ab2b541 Update dataTables.bootstrap4.js 2016-12-02 17:18:45 +00:00
Allan Jardine
a3722981df fixing pagination focus issue 2016-12-02 17:18:29 +00:00
Allan Jardine
327d71584b 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-12-02 17:18:14 +00:00
Allan Jardine
16c081d889 Dev: Fix recursion error with Responsive from last commit. Need to be
more selective about when we fire `column-visiblity`!
2016-12-02 17:17:58 +00:00
Allan Jardine
e9fc9dab2f Dev: A JS error was introduced with the column visiblity change - undefined variable.
- Need to use two iterators for the columns visible unfortunately
2016-12-02 17:17:26 +00:00
Allan Jardine
d9775c4085 Fix: Performance issue when using columns.visible() as a setter.
The column resize was being called for every column.
2016-12-02 17:16:39 +00:00
Allan Jardine
76c4283b47 Fix: Bootstrap 4 flexbox grid
The flexbox enabled grid in bootstap 4 requires the lowest `.col-` to be set. https://github.com/twbs/bootstrap/issues/17603#issuecomment-180862254
2016-12-02 17:16:23 +00:00
Allan Jardine
1071d82541 Merge branch 'master' of github.com:DataTables/DataTablesSrc 2016-12-02 17:16:08 +00:00
Allan Jardine
9a8636af2a Fix - example: Direct link to dt-init ajax.data from its example 2016-12-02 17:15:49 +00:00
Allan Jardine
38d7e00e30 Merge pull request #70 from markvantilburg/patch-7
Fix: Remove obsolete CSS option for Firefox
2016-12-02 17:15:33 +00:00
Allan Jardine
aa23ed8744 Merge pull request #71 from markvantilburg/patch-6
Fix: Remove obsolete CSS option for Firefox
2016-12-02 17:15:17 +00:00
Allan Jardine
03c918d92e Merge pull request #72 from markvantilburg/patch-4
Fix: Remove obsolete CSS option for Firefox
2016-12-02 17:15:02 +00:00
Allan Jardine
7e9ef80c58 Merge pull request #73 from markvantilburg/patch-2
Fix: Remove obsolete CSS option for Firefox
2016-12-02 17:14:46 +00:00
Allan Jardine
d7c1892cb2 Update jquery.dataTables.scss 2016-12-02 17:14:29 +00:00
Allan Jardine
ef61fb5ded Update dataTables.uikit.scss 2016-12-02 17:14:13 +00:00
Allan Jardine
31c7312f9f Update dataTables.semanticui.scss 2016-12-02 17:13:57 +00:00
Allan Jardine
1416aabcc9 Update dataTables.foundation.scss 2016-12-02 17:13:24 +00:00
Allan Jardine
3f0245edd6 Update dataTables.bootstrap4.scss 2016-12-02 17:13:08 +00:00
Allan Jardine
aa14a9e50d Dev: Update markdown to allow a line break with a single line.
- This is primarily for the forum
- This is quite common in markdown extensions now and has plenty of
  backup from Stackoverflow etc to suggest it is a good idea. About time
  I did it as well!
2016-12-02 17:12:34 +00:00
Allan Jardine
321be3bdb3 Remove prefixed -moz-box-sizing (not needed since ff 29)
https://developer.mozilla.org/en-US/Firefox/Releases/29
2016-12-02 16:46:11 +00:00
Allan Jardine
130687eeef Fix: caption tags should have the caption-side CSS value read from the caption tag itself, not the tabe tag.
- See thread 38094. Thanks _puls_!
2016-09-30 11:15:24 +01:00
Allan Jardine
0034f6c63e Fix: Using -init columns.data to access a data point which uses a backslash in its name would result in an error due to an incorrectly escaped regex.
- Fixes DataTables/DataTables #869
2016-09-29 16:22:53 +01:00
Allan Jardine
deaf51cef5 New: -api $.fn.dataTable.isDataTable() will now check for DataTable API instances as well (i.e. variables passed in)
- Thread 38053
2016-09-29 11:28:42 +01:00
Allan Jardine
62b6cb1b56 Fix: If initialising a DataTable when the window was horizontally scrolled the browser detection would incorrectly determine that rtl layout was being used (effects scrolling view).
- Issue was due to the use of `position:fixed` for the element - from
  c856d0eb232ce41c76d0c30739d33e47cc7288f4. Ironically that change just
  moved the issue that it was trying to solve!
- Fixes DataTables/DataTables #866
2016-09-21 10:57:59 +01:00
Allan Jardine
1e4dccb54d Dev: Fix no selector issue introduced by dfbf4fa23aa0952ee007bca06b791c2cd0ad48bb 2016-09-20 09:14:08 +01:00
Allan Jardine
f7d4b8a9cc Fix: Row selector would incorrectly select rows if row index 0 was passed in with a selector modifier.
- See thread 37834. Much qudos to `guyclairbois` for spotting this and
  test case!
2016-09-19 16:30:12 +01:00
Allan Jardine
010e070ff0 Merge branch 'master' of github.com:DataTables/DataTablesSrc 2016-09-19 16:29:36 +01:00
Allan Jardine
46d10406a2 Added tests for columns API 2016-09-19 16:27:30 +01:00
Allan Jardine
71fcdec54b Fix: Fooundation 6 styling for the processing element needs to use the callout class
- Fixes DataTablesSrc #82
2016-09-16 14:54:19 +01:00
Allan Jardine
ad129699b6 Merge branch 'master' of https://github.com/DataTables/DataTablesSrc 2016-09-16 14:51:45 +01:00
Allan Jardine
3987e441b8 Added modified tests for stateLoad/stateSave 2016-09-16 14:51:28 +01:00
Allan Jardine
ddec443008 Dev: 1.10.13-dev version indicator 2016-08-23 16:01:42 +01:00
Allan Jardine
19a3832792 Dev: Trigger a state save on the first draw like before
- Bug was introduced by the ordering of the code for the callback state
  loading
2016-08-23 16:01:25 +01:00
Allan Jardine
02e5dbcf7a Fix: jQuery selectors which had a comma in them were incorrectly split by DataTables causing them to be invalid or give incorrect results
- fb-87
- Forum thread 34641
2016-08-23 14:32:50 +01:00
Allan Jardine
fb708efe7e Fix: Number renderer was not correctly rounding values
- Add number renderer tests
2016-08-23 11:25:50 +01:00
Allan Jardine
55e0c4da2c Merge branch 'master' of github.com:DataTables/DataTablesSrc 2016-08-23 11:25:33 +01:00
Allan Jardine
f4d266b5c7 Added test plans for table api 2016-08-23 11:25:16 +01:00
Allan Jardine
26fb2b9524 New: -init stateLoadCallback can now use a callback function for async loading of state data, rather than requiring it to be sync.
- async is deprecated in the XHR spec and will be removed from Chrome
  (m53 I think).
2016-08-22 16:31:19 +01:00
Allan Jardine
cd3719e3a9 Merge branch 'master' of https://github.com/DataTables/DataTablesSrc 2016-08-22 16:28:29 +01:00
Allan Jardine
3d425d98b5 Fixed several typos in documentation 2016-08-22 16:28:11 +01:00
Allan Jardine
be6d4820ee Merge branch 'master' of github.com:DataTables/DataTablesSrc 2016-08-22 16:27:54 +01:00
Allan Jardine
b5ce731f1d Merge branch 'master' of https://github.com/DataTables/DataTablesSrc 2016-08-22 16:27:20 +01:00
Allan Jardine
267b8bc843 Modified tests for columnDefs 2016-08-22 16:26:46 +01:00
Allan Jardine
cb09b1871b Fix: Remove deprecated jQuery $().bind() and $().unbind() use, replaced with the $().on() and $().off() methods.
- DataTables explicitly supports only jQuery 1.7+. `on` and `off` were
  introduced in 1.7, so this isn't a problem.
- jQuery migrate shows warnings if bind and unbind are used
- Fixes DataTables/DataTables #853
2016-08-09 17:58:41 +01:00
Allan Jardine
a588b58ec3 Merge branch 'master' of https://github.com/DataTables/DataTablesSrc 2016-08-09 17:58:10 +01:00
Allan Jardine
b41e559175 Modified tests for columnDefs 2016-08-09 17:57:39 +01:00
Allan Jardine
3511506728 Performance: Faster row selection for multiple rows (-api rows()) by reusing the allowed row index array 2016-08-09 17:57:08 +01:00
Allan Jardine
3bab6dcffd Merge branch 'master' of https://github.com/DataTables/DataTablesSrc 2016-08-09 17:56:21 +01:00
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
82766d393e Fix: Align "show entries" text correctly for cases where the Semantic UI JS is not available on the page 2016-05-20 14:08:26 +01:00
Allan Jardine
e77fb75e07 Fix: Semantic UI styling with a scrolling table 2016-05-20 12:24:43 +01:00
Allan Jardine
b19d2846cb Dev: Apply previous fix to Bootstrap 4 as well 2016-05-20 12:24:02 +01:00
Allan Jardine
c804d7a6df Fix: Apply border-collapse: separate to Bootstrap styled DataTables
- Previously it was only used for tables which were marked with the
  `table-bordered`, but that caused issues with scrolling tables which
  are borderless.
- See DataTables/FixedColumns #57
2016-05-20 12:23:21 +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
b36cf4bdda Merge branch 'master' of github.com:DataTables/DataTablesSrc 2016-04-18 15:09:01 +01:00
Allan Jardine
c439436bc7 Fix - example: Direct link to dt-init ajax.data from its example 2016-04-18 15:08:25 +01:00
Allan Jardine
92a59348ef Merge pull request #70 from markvantilburg/patch-7
Fix: Remove obsolete CSS option for Firefox
2016-04-18 15:07:47 +01:00
Allan Jardine
c4d2ab8e81 Merge pull request #71 from markvantilburg/patch-6
Fix: Remove obsolete CSS option for Firefox
2016-04-18 15:07:11 +01:00
Allan Jardine
dd31b8b1f1 Merge pull request #72 from markvantilburg/patch-4
Fix: Remove obsolete CSS option for Firefox
2016-04-18 15:06:34 +01:00
Allan Jardine
0a3da850cb Merge pull request #73 from markvantilburg/patch-2
Fix: Remove obsolete CSS option for Firefox
2016-04-18 15:05:59 +01:00
Allan Jardine
2f7feab531 Update jquery.dataTables.scss 2016-04-18 15:05:21 +01:00
Allan Jardine
6a81c5e55a Update dataTables.uikit.scss 2016-04-18 15:04:45 +01:00
Allan Jardine
6422ea4a9c Update dataTables.foundation.scss 2016-04-18 15:04:06 +01:00
Allan Jardine
7acd79f7ea Update dataTables.bootstrap4.scss 2016-04-18 15:03:19 +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
817ba877ed Fix - styling: jQuery UI - don't override text colour
- Thread 31246
2015-11-06 14:53:29 +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
Allan Jardine
c55f460e6d Dev: Removing the Chrome workaround - this appears to be extremely hard
to reproduce the error and it is only occuring on Chrome Mac with a
combination of the CSS in the DataTables demos specifically. This is an
edge case that I'd rather not add code for at the moment.
2015-10-22 11:39:02 +01:00
Allan Jardine
40dda9c24f Fix: If dt-init scrollX is enabled for a table that doesn't need horizontal scrolling, but does have vertical scrolling, when the table is filtered to have no vertical scrolling the columns would be misaligned due to the column widths not being recalculated for the new table width.
Fix: Chrome has an odd bug whereby the max-height needs a reflow in order to be correctly calculated - otherwise a gap could appear at the bottom of the table

- Haven't been able to reproduce the Chrome issue in a simple test case
  - its something to do with the scrollbars being shown while the scroll
  column calculations / updates are being done and then no longer
  being needed ater that point.
2015-10-22 11:18:39 +01:00
Allan Jardine
b2f1dd5d99 Fix - CSS: jQuery UI styling with cell-border class and scrolling enabled could have the columns looking like they are slightly misaligned (1px) due to an incorrect border assignment
- Need to have the border modification in the header match how the body
  works - i.e. on the left do the collpase
2015-10-21 09:44:22 +01:00
Allan Jardine
727937c836 Dev: Fix whitespace issues from #57 - looks like a merge diff error
Dev: Code style updated to match DataTables (unwritten!) standard
Dev: Removed some of the protection on the cell index update on row
  delete - it is safe to assume that since we have a cell node, we've
  assigned an index to it.
2015-10-13 15:31:07 +01:00
Allan Jardine
00100f5afe Merge pull request #57 from strang91/master
Updated: Performance improvement by caching cell indexes for use with cell selectors
2015-10-13 15:30:38 +01:00
Allan Jardine
3b867f209c New: Pass the recalculation parameter through to the dt-event column-visibility event allowing listeners to optimise for it 2015-10-13 15:30:18 +01:00
Allan Jardine
e8fc79f858 Fix: Bootstrap and Foundation integration XHTML error for ellipsis entity
- From @dstoeckel DataTables/Plugins/pull/225
2015-10-13 15:29:49 +01:00
Allan Jardine
6fc22e712d Fix: Some reset stylesheets will set vertical-align:baseline on all elements, which causes the header cells in a table body to be visible. 2015-10-13 15:29:01 +01:00
Allan Jardine
08d61efa63 Dev: Naming for AMD and CommonJS loaders set to a unique value that will be useable on bower and npm due to no conflicts.
- Using just `datatables` would be difficult since I and others already
  publish packages with that name. Anyone using those packages already
  would run into real issues if I were to change their meaning and
  contents!
2015-10-13 15:28:14 +01:00
Allan Jardine
954a3b080b Update cell node indexes when removing a row 2015-10-13 15:26:36 +01:00
Allan Jardine
d481e0d441 Update: Updating the AMD and CommonJS loaders
- Cannot pass in a `dt` instance - will always use the one from the
  jQuery instance given
- Don't check for reinitialisation or for jQuery when working in the
  browser - will throw an error if in browser and no jQuery, which is
  correct, DataTables needs jQuery
2015-10-06 12:06:06 +01:00
Allan Jardine
dd5ddd46a0 Fix: Performance improvement for the every() methods. Rather than a new API instance being excplicitly created for every item, use the exisiting instance as the basis for the selector.
- The item selector returns a new instance, so there is no impact upon
  compatiblity
2015-10-06 12:05:19 +01:00
Allan Jardine
c0cb3db92f New: DataTables no longer defines itself as a named AMD module
New: CommonJS will load jQuery if it wasn't passed in
Fix: Bootstrap, Foundation and jQuery UI integration Javascript files use module.exports correctly
Dev: Change the file include "function" name to not conflict with `require`

- AMD / RequireJS - The Require documentation strongly discorages using
  a named module, but I've used this in the past as the plug-ins need a
  name to depend upon themselves. This is still `datatables` but if the
  developer is using Require and it resolves automatically to a
  different name (which it may depending upon their configuration) they
  can use a map option to map their name to `datatables`. See
  https://github.com/moment/moment/issues/1095

- CommonJS - Based on the disscussion in
  https://github.com/DataTables/Plugins/issues/199 it seems that some
  developers like to pass a certain version of jQuery in. This
  modification allows them to do so while retaining backwards
  compatiblity.

- Integration files - The UMD wrapper for these files have been
  restructured to be easier to follow. Also, based on the discussion in
  the Plugins issue noted above you can now pass in a jQuery instance or
  not and likewise a DataTables object or not.

- To avoid direct conflict with `require()` the build scripts have been
  updated to use a "function" called `_buildInclude`. Ultimatily this
  should really be updated to use grunt or similar.
2015-10-06 12:03:36 +01:00
Allan Jardine
9fe4110826 Fix: Improve integration for NPM / CommonJS - jQuery object to augment can now be passed in. This applies to DataTables core as well as the integration files for Bootstrap, Foundation and jQuery UI 2015-10-06 12:02:51 +01:00
Allan Jardine
5e34369a56 Fix: Column width calculation could be incorrect when not using any user defined widths or hidden columns
- All credit to @montrothstein for finding and fixing this -
  DataTables/DataTables #681
2015-10-06 12:02:08 +01:00
Allan Jardine
ea9e926b53 Dev: Output a warning if html tidy is not installed
- I just updated my PHP and HTML Tidy was not installed which resulted
  in the examples in the dist repo all being rewritten unfortunately.
  This should stop that happening again.
2015-09-25 10:08:52 +01:00
Allan Jardine
b84cc6063e Fix: The every() method did not have the selector options applied to it - this was particularly noticable with the dt-api columns().every() method
- See DataTables/DataTables #679 and https://jsfiddle.net/7mgny9gb/2/
- Thanks @mpryvkin for noting this bug and the test cases
2015-09-25 09:50:54 +01:00
Allan Jardine
5a833056c1 Fix: Don't trigger a draw when clicking on paging button for the current page - Bootstrap and Foundation only
- This fixes DataTables/DataTables #662
2015-09-21 17:00:07 +01:00
Allan Jardine
52b30868a1 New: dt-api order.fixed() to get / set the fixed ordering of the table 2015-09-16 15:55:05 +01:00
Allan Jardine
b03863fae7 Fix - styling: Add support for Bootstrap's responsive tables
- Bootstrap's CSS doesn't allow for using rows inside the
  table-responsive class, so we need to add a couple of overrides to
  support this.
- See thread 29738. Thanks danielbsnake72 and bkates for the input
2015-09-11 11:59:57 +01:00
Allan Jardine
898cdca4ff Fix: If x-scrolling is enabled using $.fn.dataTable.defaults.scrollX=true; an error would occur
- Fixes thread 30084
- Error introduced by commit 67ed583159419cec6fee14c5ecaafc5f75e7cf5c
2015-09-10 10:00:00 +01:00
Allan Jardine
c400231c86 Fix - styling: Add styling for the processing message in Bootstrap and Foundation
- This fixes DataTables/Plugins #215
2015-09-09 14:03:18 +01:00
Allan Jardine
561b88551e Fix: Adding a default builder string into the ext object to allow builder sourced files to work with require.js
- This comes about from thread 29819 which highlights that inserting the
  buidler string as a variable into the static file causes issues.
- This will only take effect once 1.10.10 has been released
2015-09-09 14:02:25 +01:00
Allan Jardine
832fc24156 Dev: Removing unit tests from the distribution repo 2015-09-08 10:41:09 +01:00
Allan Jardine
a75f0a7057 Fix: Row ids were not being automatically picked up from DOM sourced tables 2015-09-07 15:54:36 +01:00
Allan Jardine
c40604d2c1 Moving on to 1.10.10 development 2015-09-07 15:54:09 +01:00
Allan Jardine
b1bca78111 DataTables 1.10.9 release 2015-09-01 09:51:29 +01:00
Allan Jardine
648726b19e Fix: When using a cell selector, if the element doesn't have a parent node (caused by it being hidden and a jQuery selector being used) an error would be thrown.
- The fix is to loop over the data array to find the cell. Slower, but
  for an edge case I think this is an approriate fix.
- This fixes DataTables/DataTables #653
2015-09-01 08:38:38 +01:00
Allan Jardine
119a355970 Fix: It was possible to select an item multiple times using redundant selectors.
- Example: table.rows( ['', '', '', ''] ) would have selected all rows 4
  times!
2015-09-01 08:38:09 +01:00
Allan Jardine
8a4dc8a9d7 Fix: Using Array.prototype.push.apply can fail on larger tables / queries due to limits on the number of arguments that can be passed to a function, imposed by the various Javascript engines.
- The fix is to replace with more approriate options. The jquery
 `$.merge` function in particular is useful and array concat when we
 don't need to maintain a refernce.
- This fixes DataTables/DataTables #651
2015-08-31 14:26:04 +01:00
Allan Jardine
e48efdf316 Fix: Setting non-array data when DataTables has been told to expect an array results in a Javascript error. Although this is somewhat unexpected input, it is reasonable to expect DataTables to handle null values here, even although an empty array is much prefered.
- THis fixes DataTables/DataTablesSrc #55
2015-08-31 14:25:09 +01:00
Allan Jardine
4f27154fe4 Fix: Clear cache of row ids when the table is cleared. This is particularly important when server-side processing since the rows should no longer exist on the client-side when paging between records. 2015-08-28 12:20:41 +01:00
Allan Jardine
726bfe5ebb Fix: Rows could still be selected by id after they had been removed from the table. This could result in a memory leak as well as rows being selectable when they shouldn't be. 2015-08-28 12:20:11 +01:00
Allan Jardine
3a43de4224 Fix: Column data setter function would be called twice for the first row in the table
- This was caused by using `_fnGetRowElements` to get the cells. While
  it was good for performance with large number or rows to do so, it
  isn't needed for a single row and a single line of jQuery is simpliler
  and doesn't trigger the set function
- Fixes DataTables/DataTables #638
2015-08-27 10:54:28 +01:00
Allan Jardine
4e611f31ff Fix - styling: Bootstrap and Foundation would apply padding to a header cell, making space for a sort icon, even when the column is not sortable.
- This fixes DataTables/DataTables #639
2015-08-26 14:35:18 +01:00
Allan Jardine
03dc5a31ac Fix: When using a DOM data source, the cell's data function, as a setter, would be called twice
- The issue was effectively duplicate code - for 1.9- compatiblity when
  I introduced 1.10 I had the set function run specifically if a DOM
  node was given. But later in the 1.10 series when it became possible
  to have the data written to an object rather than an array, that code
  would itself call the setter, thus leading to two calls when there is
  a DOM node present for the row.
- The first is simply to remove the code that was running the setter for
  the DOM specific case.
- This fixes DataTables/DataTables #638 and thread 25846. Thanks to
  @Jamaur and @strang91 for following up on this.
2015-08-25 15:10:06 +01:00
Allan Jardine
17d0ce4cce Fix: Columns could be set to 0 width in IE6/7 when there are hidden columns in the table
- This fix also comes out of DataTables/DataTables #633. Thanks again to
  @nddery and @epitaphmike.
2015-08-25 14:18:58 +01:00
Allan Jardine
7d3c5cc276 Fix: Browsers on Macs with zero width scrollbars would be incorrected treated the same way as IE6/7 causing column width calculations to be incorrect.
- The issue was caused by the check for the `bScrollOversize` option
  which looks for the container being the same width as its inner
  content area. Obviously that happens to be true if there is no
  scrollbar. Adding a check for the clientWidth not being 100 as well
  resolves this.
- I've also combined the scrollbar width detection with the other
  browser detect functions. The two functions were performing very
  similar operations and so easily combined
- The browser detect DOM creation will only run once, rather than for
  every table initialisation, optimising multi-table loading
- Fixes DataTables/DataTables #633 - Thanks to @nddery and @epitaphmike
  for the input
2015-08-25 14:18:30 +01:00
Allan Jardine
e7e439dd0a Fix: Cell invalidation would fail due to incorrect logic
- If d or objectRead were truthful then the row's data object would be
  replaced with an empty object. This was one shortcut in code too many!

- Relates to thread 29530 with thanks to idleog.
2015-08-19 14:40:22 +01:00
Allan Jardine
9ef7f1ad20 Fix: Compatibility with jQuery 2's isPlainObject. API instances were returning as plain objects
- This appears to be caused by setting the prototype chain as an object
  directly. For example:

  var test = function () {};
  test.prototype = {};
  $.isPlainObject( new test() );

  will return `true` with jQuery 2.1.4 (and `false` for 1.11.3).

  If an item is added to the prototype object then it will return
  `false`, although for some reason that wasn't the case with
  DataTables' API prototype.

  More investigation required, but for full compatiblity with exisiting
  jQuery releases, the correct thing to do here is to build on the
  exisiting prototype, which we can do with `$.extend`.
2015-08-19 12:25:28 +01:00
Allan Jardine
0482633dff Fix - CSS: Bootstrap and Foundation were missing the empty row class to align text to the center 2015-08-19 09:55:39 +01:00
Allan Jardine
3950e119e2 Fix - docs: Add note to dt-api draw() that the string options require 1.10.8 or newer 2015-08-19 09:54:48 +01:00
Allan Jardine
a6e75123eb Update rows().ids().xml
Spell mistake
2015-08-19 09:54:19 +01:00
Allan Jardine
7898f4e585 Merge branch 'master' of github.com:DataTables/DataTablesSrc 2015-08-19 09:53:47 +01:00
Allan Jardine
52531db870 Update selector-modifier.xml
Just a small spell mistake
2015-08-19 09:52:44 +01:00
Allan Jardine
085d7f3137 Fix: Row invalidation would throw an error when reading from a DOM row
- Fixes DataTables/DataTables #623
2015-08-17 09:34:39 +01:00
Allan Jardine
44b1402fa6 DataTables 1.10.9 development starts 2015-08-17 09:34:10 +01:00
Allan Jardine
953d1fc6ca Add minified integration files 2015-08-12 20:17:46 +01:00
Allan Jardine
3977c5de72 Sync with latest DataTablesSrc 2015-08-12 19:50:30 +01:00
Allan Jardine
f91373337b DataTables 1.10.8 release 2015-08-12 19:49:47 +01:00
Allan Jardine
60273a0a75 Dev: Update the new rowId option to be able to read the id from the DOM 2015-08-12 19:49:29 +01:00
Allan Jardine
9cc3be030f Fix: Calculation for horizontal scroll bar adjustment when the dt-init scrollCollapse parameter is set could be incorrect when the standard height exceeds the window height.
- This is an interesting one, and I suspect a bit of an edge case in the
  browsers - what is happening is that the window is going from having a
  scrollbar to not having a scrollbar when the scrolling viewport is
  collapsed. This causes the browser to show the scrollbars in the
  viewport for an instant, even although they aren't actually required.
  If the height of the viewport is 53px and you up it to 80 so there are
  no scrollbars and reduce it back to 53 the scrollbars are gone! The
  browser must be stopping a race condition once the scrollbars are
  shown.

- The fix is to use `max-height` for the scrolling container if the
  scroll collapse is set and `height` otherwise. The browser native
  methods makes the code _much_ easier to work with, more performant and
  easier to understand.
2015-08-10 17:47:34 +01:00
Allan Jardine
07c04c69f8 Dev fix: Commit f2df0716 removed a check for IE6/7 to disable the smart
column width for these tables. However, that was in error - it is in
fact required still as the smart width calculations cause the browser to
crash (APPCRASH). There is no indication as to why this is, not is it as
simple as just disabling one or two pieces of code to stop the crash.
This leads me to suspect that it is the number of operations being
performed - particularly to do with the cloning of the elements. If this
is the case, then its just never going to work. Also IE6/7 are such a
small market now (thank goodness) this is just a feature that won't be
available in those browsers.

If anyone is interested in working on fixing it, or paying me to do so,
I'm happy to hear from you :-)
2015-08-10 17:47:12 +01:00
Allan Jardine
d0e9e78db4 Fix: Horizontal scrolling could incorrectly be triggered in Firefox when there is lots of room available and scrolling is not required. This was due to sub-pixel rendering of the columns, but the widths being rounded up to integer values. Using getBoundingClientRect addresses this. IE8- have to continue using the old method.
Fix: The auto width calculation table, when scrolling is enabled, being inserted into the scrolling container could cause the viewport to scroll, even when the main table doesn't actually need scrolling. This causes the column width calculations to be incorrect by the scrollbar's width. The fix is to have the calculation table `position:absolute` in the scrolling container and height:1px so it has no effect on the vewport's scrolling.

- These two fixes address DataTables/DataTables #612. Kudos to @Delgan
  for reporting these issues and supplying test cases - thanks!
2015-08-10 14:59:04 +01:00
Allan Jardine
bb33384e62 Update - styling: Altering the paging buttons to have a styling that is consistent with the Buttons extension. This is just a darkening of the active border and a small border radius. 2015-08-10 14:58:05 +01:00
Allan Jardine
201cc7fb69 Fix: If dt-init deferRender was enabled, the dt-event init event wouldn't trigger until after the table's second draw.
- This could be seen specifically when using Responsive with a defer
  rendered table - Responsive wouldn't kick in until after the second
  draw.
2015-08-06 20:42:01 +01:00
Allan Jardine
a2948e4c1e Fix: Simplification and improvement of table widths when scrolling
Fix: Table could overscroll if `dt-init data` is used to populate the table

This is a fairly significant change to how DataTables operates for the
scrolling width calculations and primarily is due to a simplification
with the use of `clientWidth` to get the scrolling container width.
Rather than getting the offsetWidth and then removing the scrollbar
width if required the `clientWidth` will give us the value directly.

With the scrollbar width already accounted for the scrolling draw code
can be updated to not need to account for it itself.

Finally, when using the `data` property to add data to the table we need
to recalculate the column widths after the first draw, just like with
Ajax loaded data, otherwise the data added won't be taken into account
and we can get an error in the scrolling.
2015-07-24 15:38:59 +01:00
Allan Jardine
11dbd3ca52 Fix: Mixed tabs and spaces 2015-07-24 11:45:08 +01:00
Allan Jardine
534e281b39 New: dt-api draw() now accepts a string parameter which can be used to perform a simple redraw without the need to reorder / research the table. This is useful for paging where, otherwise, it would be a performance hit. 2015-07-24 11:44:34 +01:00
Allan Jardine
d1352ac898 Merge branch 'master' of github.com:DataTables/DataTablesSrc 2015-07-24 11:43:09 +01:00
Allan Jardine
fcd96cc5e3 Fix - docs: dt-api rows().every() example was missing a parameter
- This fixes DataTables/DataTables #608
2015-07-24 11:42:49 +01:00
Allan Jardine
b61ac2a9db Resolve issue with focusing when there are multiple graphs updating on the same page 2015-07-24 11:42:12 +01:00
Allan Jardine
4222dec97d Merge branch 'master' of github.com:DataTables/DataTablesSrc 2015-07-15 17:10:41 +01:00
Allan Jardine
4b378ff787 Dev: Updating the XML for the external styling examples to use the new example build framework 2015-07-15 17:10:24 +01:00
Allan Jardine
821e866ac0 fix for incorrect calculation in _fnBrowserDetect
when body's position is changed (left: 375px) _fnBrowserDetect incorrecly calculates offsets. thus header is a bit misaligned. commit changes test object's position to fixed. in this case it's position will
be relative to the viewport not to the body.
2015-07-15 17:09:48 +01:00
Allan Jardine
1447c26a78 Fix: Potential memory leak when using static events on table elements and destroying tables
When the table was being destroyed and the remove parameter was passed
in as `true` to remove the table from the DOM there was potential for
bound events to not be unbound from the table elements. This was caused
by the use of the `detach` jQuery method which will not remove events.
Furthermore, rows would not be added to the table before this method (or
`remove()`) was called. As such we need to reorder the code slightly -
attach the rows back into the DOM and then remove them (or detach if the
table is left in the DOM) - otherwise rows which were hidden by paging
would not have their events unbound.

Many thanks for KnowledgeNet ( http://kn-it.com/ ) for their support in
finding and allowing this bug to be addressed!
2015-07-09 10:21:10 +01:00
Allan Jardine
549bd19854 New: Optimised ID selectors - Also works when rows have not yet been rendered.
Being able to get and keep a reference to each row is quite important.
You can't use the DataTables row index for this as it can potentially
change, but we can use IDs, based on a unique value for each row in the
data - `dt-init rowId`.

I've made the decision to not require escaping of data in the ID. This
means that selectors can be ID selectors with a cobontation of other
things (#div.class for example) as that really doesn't make much sense
in this contact - you only have rows that you can select from. Not
requiring escaping makes both the client and library code much easier.
This is documented.

The implemention is to store a reference to each row's data object based
on its id allowing for a trivial lookup. The object has its own index
in the `aoData` array, so there is no `indexOf` required. The only
downside is that the index must be updated when a row is deleted. This
is done with a trivial for loop.
2015-07-06 21:05:27 +01:00
Allan Jardine
abc683d393 Dev: dt-api rows().ids() and dt-api row().id() methods should return undefined if a row's id is undefined 2015-07-06 21:05:08 +01:00
Allan Jardine
7e2c6b4d0f New: dt-api page.info() includes a new parameter to indicate if server-side processing is being used or not for the table 2015-07-06 21:03:56 +01:00
Allan Jardine
dda351a54e Fix: Row details could potentially throw an error if used on an row that doesn't exist (might have been removed) 2015-07-06 21:03:39 +01:00
Allan Jardine
29fd57569a New - dt-api $.fn.dataTable.tables() can now return an API instance which makes for easy chaining to call methods on the selected tables. This is done by now being able to provide an object (providing two booleans is confusing unless you have the manual right next to you!) 2015-07-06 21:01:47 +01:00
Allan Jardine
36929eade3 Fix: Initialisation on an element other than table would result in a Javascript error
* Issue was that an `error` event was being triggered before the
  settings object had been configured. There is no option to trigger an
  error event in this case.
* Fixes DataTables/DataTables #572
2015-06-10 09:48:45 +01:00
Allan Jardine
5a47fe5a9b Merge branch 'master' of github.com:DataTables/DataTablesSrc 2015-06-10 09:48:26 +01:00
Allan Jardine
dd6612f24a New: dt-event preInit event - emitted while a table is being initialised, allowing developers to modify the data being requested by DataTables for the first draw of the table. Used by Scroller 1.3.0 and likely will be by other extensions soon. 2015-06-10 09:48:06 +01:00
Allan Jardine
4cd2132607 Dev: Remove comments from SCSS file that are redundant 2015-06-10 09:47:44 +01:00
Allan Jardine
a5613441dc Dev: Add Scroller as a framework library 2015-06-10 09:47:23 +01:00
Allan Jardine
1effb64cfa Fixed event handlers in table headers in IE8
On line 605, column.sTitle is set to the TH's innerHTML.
On line 1816, column.sTitle is compared with cell.html().

If you have child elements with event handlers on them inside the TH, these are not the same in IE8 (see https://gist.github.com/simonbrent/933e552739477f4be3ab#file-test-html)

As a result, the check on 1816 fails, the contents of the cell is replaced, and the event handlers are removed.

Comparing instead with cell[0].innerHTML fixes this issue.
2015-06-10 09:45:55 +01:00
Allan Jardine
cf1e9d1fab Fix: dt-api ajax.reload() should cancel an exisiting request if that request has not yet completed
- Thread 28197. Thank you _womplify_!
2015-06-08 11:13:56 +01:00
Allan Jardine
f9cdaead17 Dev: Fix trailing comma 2015-06-04 15:35:06 +01:00
Allan Jardine
801e4bedf1 New: dt-init rowId option to specify what property should be used from the row's data source object to read the row's id and then set it as the DOM id (previously this was static as the DT_RowId option)
New: `dt-api row().id()` and `dt-api rows().ids()` to get the id from one or multiple rows, based on the new `dt-init rowId` option
2015-06-04 15:26:45 +01:00
Allan Jardine
759ea3d733 Update: The dt-api rows().every(), dt-api columns().every() and dt-api cells().every() methods are now passed index and loop counter parameters 2015-06-03 17:07:55 +01:00
Allan Jardine
d95820dd2a New: dt-api count() method. This provides a short cut method to determine how many items have been selected by the API. This can be useful to count the number of selected rows, etc. 2015-06-03 17:07:17 +01:00
Allan Jardine
4f3525786d Update: Add postfix option to the number renderer option 2015-06-03 17:06:58 +01:00
Allan Jardine
f817194a09 Fix: If the paging language options were set to be an empty string, the button wouldn't render. This is not correct as it doesn't allow CSS icons to be used rather than the strings. 2015-05-30 14:10:31 +01:00
Allan Jardine
3de8e7c3fe Merge branch 'master' of github.com:DataTables/DataTablesSrc 2015-05-30 14:10:12 +01:00
Allan Jardine
04598f91ff Fix - docs: dt-api row.add() and dt-api rows.add() will accept tr elements 2015-05-30 14:09:54 +01:00
Allan Jardine
feccbc5968 jq 2.1.4 sppt 2015-05-30 14:09:19 +01:00
Allan Jardine
59457b63e6 Fix example: Server-side processing data source example column titles were incorrect 2015-05-30 14:09:03 +01:00
Allan Jardine
09ff48a486 New: Add numbers paging option for dt-init pagingType to round off the full set of basic options
Thank you `rubenduiveman` for suggesting this enhancement
2015-05-13 13:51:23 +01:00
Allan Jardine
c61947f5f3 Fix: dt-init scrollX could not be given as false - it still enabled x-scrolling 2015-05-06 16:18:28 +01:00
Allan Jardine
7081a1a7c6 1.10.8-dev version flag 2015-05-06 11:31:46 +01:00
Allan Jardine
768f7cdc46 Fix: Disabling smart column width for IE67 as it can cause the browser to crash 2015-05-06 11:30:27 +01:00
Allan Jardine
17130d2fd5 Fix: When scrolling is enabled and column visiblity is toggled a Javascript error would occur due to the column width calculation method cloning the wrong header element.
This fixes thread 27612 and DataTables/DataTables issue #553
2015-05-06 11:30:10 +01:00
Allan Jardine
ded5ee322c Dev: Bringing the integration files for the various frameworks that DataTables supports into the repo
This is so each repo defines its own integration files, ensuring that
they are both easy to update and that they are up-to-date. I will be
blogging about this change next week.
2015-05-06 11:27:47 +01:00
Allan Jardine
fc64e71e1c DataTables 1.10.7 release 2015-04-30 15:08:43 +01:00
Allan Jardine
2f85ace4a1 Fix: IE6/7 could crash completely when using auto width due to a clone of a clone occuring. This was bad for performance anyway and has been rewritten to resolve both the IE crash and performance issue
See thread 27428 for further information
2015-04-30 14:01:55 +01:00
Allan Jardine
5484fdaec3 Fix: For convenience $.fn.dataTable.Api() will now automatically construct a new DataTables API instance (i.e. it is functionality identical to calling new $.fn.dataTable.Api(). This addresses an outstanding todo item and an error in instanceof logic for the exisiting constructor 2015-04-30 14:01:16 +01:00
Allan Jardine
362ec532f2 Dev: Update to jQuery 1.11.3 2015-04-30 14:00:53 +01:00
Allan Jardine
432a0dc18a New: dt-event xhr can now return true to have DataTables not trigger the dt-event error event for cases where you've handled the error yourself now that dt-event xhr is triggered on error as well 2015-04-30 10:02:16 +01:00
Allan Jardine
e4a12ed19d New: Always trigger the dt-event xhr event on completion of an Ajax request, regardless of whether it was successful or in error
New: The jQuery XHR object is passed into the `dt-event xhr` event as the fourth parameter

* This fixes DataTables/DataTables #542
2015-04-29 21:52:34 +01:00
Allan Jardine
8376ac8412 Fix: IE6/7 could crash when loading a DataTable on page load due to the binding of a resize event listener on the window object
* Reported in thread 27428
* This SO thread was helpful: http://stackoverflow.com/questions/1264443
2015-04-29 21:19:40 +01:00
Allan Jardine
2176acf2fb Fix: $.map() expects an array, but a string could be passed in during smart search, which could cause an error with the latest jQuery libraries
This fixes DataTables/DataTables #546
2015-04-29 11:13:38 +01:00
Allan Jardine
b2adfad09c New - API: dt-api i18n() method to provide easy i18n support for developers working on extensions for DataTables and to allow dt-init language to be used as a central point of configuration for the language strings used by the table. 2015-04-29 11:13:16 +01:00
Allan Jardine
0234e9e502 Fix: Singular selectors (dt-api row() for example) did not reduce their result sets to a single item 2015-04-16 12:43:43 +01:00
Allan Jardine
c8b924772d New: External interface to allow the selector options -type selector-modifier object be extended by plug-ins, providing additional selector options. In the first instance this will be used by the new Selector extension that will add the ability to select rows, columns and cells by their selected status.
The main change here is to modify `_selector_run` to loop over the
extension functions (if there are any). This involves passing extra
information to the function (selector type so the correct extension can
be used, settings object and selector modifier to pass on to the
extension method).

The _selector_opts function has also been updated to give the ability to
use unknown properteries through a $.extend, rather than writing a three
property object.
2015-04-16 12:43:24 +01:00
Allan Jardine
b7c5f8c07f New - API: dt-api any() method which can be used to check if the API result set contains any results or not
This is useful for the multi-table aware API as it may contain inner
arrays, which themselves may or may not be empty
2015-04-15 17:05:13 +01:00
Allan Jardine
caa9f2f84b DataTables 1.10.7 development underway 2015-04-15 17:04:55 +01:00
Allan Jardine
de3a4bb72e Fix - CSS: Remove redundant CSS expressions
The specificity of pesudo selectors ranks higher than class selectors,
so `tr:hover` will always rank higher than `tr.odd`. Thus giving
`tr:hover, tr.odd:hover` is redundant and this commit removes that
redundancy.

For more about CSS selector specificity see the MDN documentation:
https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
2015-04-15 17:04:37 +01:00
Allan Jardine
fc8cc9bbd2 Fix - docs: dt-api iterator() was missing parameters (incorrect xml tag)
Dev: Remove comment about using iteratorNew - that was wrong. The
`iterator` method uses a returns parameter now
2015-04-15 17:03:08 +01:00
Allan Jardine
2d6108d00c Fix - docs: dt-api row().child() should have the class name as optional 2015-04-15 17:02:08 +01:00
Allan Jardine
34abc58d70 Release 1.10.6 2015-04-03 14:47:53 +01:00
Allan Jardine
ba42edc3f1 Fix: If a loaded state does not contain a parameter it could throw an error. This could occur when the stateSave event removed parameters from the state object
This fixes DataTables/DataTables #24
2015-04-03 14:16:57 +01:00
Allan Jardine
acf989695e Fix: $.fn.dataTable.ext.pager.numbers_length was not taken into account when showing ellipsis on both sides of the current number in the paging controller
Fix: Ellipsis elements didn't have padding which could be jarring when shifting between paging that does and doesn't show ellipsis

This fixes DataTables/DataTables #26
2015-04-03 14:16:33 +01:00
Allan Jardine
cbb5a5d6e9 Fix: dt-init row().child() couldn't accept an array of jQuery objects
See https://www.datatables.net/forums/discussion/26441 for details
2015-04-03 12:21:50 +01:00
Allan Jardine
5c919423c1 Fix - docs: dt-api row().child() notes that className is not added to pre-existing node 2015-04-03 12:21:27 +01:00
Allan Jardine
565b639c34 Fix: Scrollbar width wasn't correctly detected in IE9
Fix: Scrollbar width was being calculated everytime requested on machines with zero width scrollbars

The scrollbar width calculation method has been rewritten to use a
single element with use of `offsetWidth` and `clientWidth` to calculate
the scrollbar width. This works all the way back to IE6.
2015-04-03 12:12:15 +01:00
Allan Jardine
220ae99e08 Updated: Extend currency support to include all top 20 internationally traded currencies. This includes the Russian ruble, South Korean Won, Turkish Lira, India Rupee, Brazilian real, South African rand, Swiss franc, Swedish korona, Norwegian krone and Danish krone.
Any additional currancies should be added as a plug-in, not to the core!

Fixes DataTables/DataTablesSrc #38
2015-04-03 10:45:41 +01:00
Allan Jardine
7c4bf3e3b8 Fix - CSS: compact style could have the column title overlapping the sorting indicator
Fixes DataTables/DataTables #527
2015-04-03 09:51:11 +01:00
Allan Jardine
294a32f8d0 Fix docs: Add reference to dt-init columns.orderSequence from dt-init order 2015-04-03 09:50:06 +01:00
Allan Jardine
e0f2cfd81e Fix: When holding shift and clicking on a single sorted column it was possible to attempt to remove the sort (the internal sorting array was []). This shouldn't be possible, and now isn't.
* This fixes DataTables/DataTables #526
2015-03-31 20:05:23 +01:00