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

1049 Commits

Author SHA1 Message Date
Allan Jardine
63beec6486 Fix: DataTables/DataTables #281 - Invalidated DOM rows and hidden columns
- When invalidating a DOM row, DataTables wasn't taking into account the
  fact that the columns in the row might be hidden. This means that the
  array of data read is shortened by the number of hidden columns, and
  thus the data is corrupted.

- Fix is to read from the known cells if the row already exists
2014-04-02 14:21:46 +01:00
Allan Jardine
6cac556b6a Dev fix: Converting camelCase to hungarian was broken 2014-04-01 13:43:00 +01:00
Allan Jardine
1a5e32295a Fix: When extending the defaults using camelCase, objects didn't work
- Issue here was that when doing the camelCase to hungarian conversion
  on objects, the user object was copying over the hungarian default.
  This meant that parameters were lost and things broke! The fix is to
  decend into the object

- See thread 20233 for the original report
2014-04-01 11:07:47 +01:00
Allan Jardine
09bf9b200c Fix DataTables/DataTables #291 - non-string data support for non-'.' dec
numbers
2014-03-28 08:21:54 +00:00
Allan Jardine
6a033ad09b Fix: HTML sorting formatter should cope with null data 2014-03-26 16:30:51 +00:00
Allan Jardine
af7f2780f4 New: Smart filtering upgraded to support quoted exact match
- DataTables' smart filtering now has the ability to search for an exact
  string, in the given order, over multiple words. This is done by
  providing the exact match search string in quotes - for example:

    Angela "Cheif Exec" London

  Will match three terms - `Angela`, `Cheif Exec` and `London`. Those
  three terms will be matched in any order.

- This matches the search behaviour that we all know and love in Google!

- It can be disabled along with the rest of DataTables' smart filtering
  using the `smart` option.

- This enhancement comes courtesy of Barry Keepence. Original forum
  thread: http://datatables.net/forums/discussion/16250/. Thanks!
2014-03-25 09:49:40 +00:00
Allan Jardine
c5058c36e6 Fix: Extending objects in the API could cause scope errors over multiple tables
- See thread 20075 for the original report

- Basically the issue here was that the object being used for the API
  extension on objects (e.g. `table.ajax` is an object) the object was
  not unique to each API instance, so it was being shared between
  instances and as a result, whatever instance was created last, would
  win!

- Fix is to use a new object each time.
2014-03-24 15:16:32 +00:00
Allan Jardine
fedec2b479 Fix: Inverted logic for column.index() - 20021 2014-03-24 15:16:16 +00:00
Allan Jardine
9fda4f3a3d Fix: Multiple column options for a single column could cause custom type
to be lost

- Without a check on the `sType` option, if there was multiple column
  defintations for a single column, the custom sType could be lost
2014-03-24 15:16:00 +00:00
Allan Jardine
e89310fbcf Dev fix: fnOpen should return the child node, not the host row 2014-03-24 15:15:26 +00:00
Allan Jardine
f5103cd6c4 Fix DataTables/DataTables #289 - Filtering can break with \n
- The removal on the \n\r characters should not be dependent upon there
  being HTML enties detected in the string
2014-03-21 08:13:38 +00:00
Allan Jardine
b2a3546402 Fix: Row details show and hide methods should return this 2014-03-20 15:28:58 +00:00
Allan Jardine
75d28cad1c Fix: fnOpen should return a node, not undefined 2014-03-20 15:28:44 +00:00
Allan Jardine
67a2b18ca3 Fix: Memory leaks from not removing listeners on destroy
- DataTables uses the `DT` namespace for events internally and will
  remove them automatically on destroy, but `dt` is used for public
  events. As such, the public events used internally should use `.dt.DT`
  to ensure that the listener works as expected, but also so that the
  destroy call will remove these listeners
2014-03-20 15:19:42 +00:00
Allan Jardine
c625f2f525 Fix: Destroy should use detatch() not remove()
- This is to preserve user added listeners on destroy. If they want to
  remove their listeners to prevent memory leaks, then they should do
  so. But DataTables won't do it for them, as actually, you might want
  to keep your event listeners!
2014-03-20 15:19:26 +00:00
Allan Jardine
90870af5ac Fix: fnServerData compatiblity for 1.9-
- fnServerData's second parameter should be an array of objects with
  name/value pairs. It was being passed through as the more modern
  object, but fnServerData is only present for compatiblity with 1.9 and
  should the original format should be retained. This is done with a
  simple map function
2014-03-19 19:33:49 +00:00
Allan Jardine
b5228162a7 Fix DataTables/TableTools #46 - fnGetData should return null if row not
found

- The old fnGetData method would return null, rather than undefined for
  some reason if a given row was not found in the DataTable. The new
  wrapper api for the legacy interface should do the same.
2014-03-19 10:53:56 +00:00
Allan Jardine
d271fac5b6 Merge branch 'master' of github.com:DataTables/DataTablesSrc 2014-03-19 10:53:44 +00:00
Allan Jardine
ecceb7a2ca Fix DataTables/DataTables #288 - Column search wasn't being used 2014-03-19 10:53:33 +00:00
Allan Jardine
0dab1e20de Fix: Only report a general Ajax error when request is complete
- Previously if you cancelled an Ajax request, or the browser did (for
  example following a link) the error handler would be entered and show
  an alert. This just ensures that the request is complete before
  showing an error
2014-03-19 10:53:21 +00:00
Allan Jardine
c0c1db422f Fix: Legacy API error when using fnGetNodes on an empty table 2014-03-14 14:06:30 +00:00
Allan Jardine
3e33795877 New: Responsive CSS for core styles
- On smaller screens the table controls (length, search, info and
  paging) will show as stacked now.
2014-03-14 12:32:27 +00:00
Allan Jardine
fd857d4864 Fix: On Ajax error hide the processing display 2014-03-14 12:32:06 +00:00
Allan Jardine
ce54ab1ea5 Fix: ajax.reload() wasn't showing the processing display 2014-03-14 12:31:43 +00:00
Allan Jardine
1d0a155226 Fix: Selector was too selective for filtering in old browsers 2014-03-14 12:31:19 +00:00
Allan Jardine
302f0be0ac Fix: Ordering informationw as being sent in SSP Ajax when ordering disabled
- See thread 19860 for details.
2014-03-07 11:48:23 +00:00
Allan Jardine
9dc81c8dd3 Dev fix: Sort classes for cells were broken in beta.3-dev
- Commit 515761905c had removed the `_fnSortingClasses` call for a
  client-side processing table without defered rendering.
2014-03-07 11:48:08 +00:00
Allan Jardine
34c18509d8 Update: The _ option for columns.render as an object is optional now
- Previously when using columns.render as an object, you had to supply
  an `_` option which was the fallback. However, I've now made it so
  that if there is no `_` option it will just use the raw data from
  `columns.data`
2014-03-07 11:46:08 +00:00
Allan Jardine
e45f19eb60 New: Number formating helper
- I've come accross a lot of cases recently where numbers need to be
  formatted for display, so I wanted to introduce rendering helpers for
  DataTables to make this easier. Only one helper introduced here -
  `$.fn.dataTable.render.number()` which will return an object that can
  be used by `columns.render` to format "raw" numbers.
2014-03-07 11:45:53 +00:00
Allan Jardine
92e380c778 New: ajax.params() method to get the data for the last Ajax submit 2014-03-06 10:05:46 +00:00
Allan Jardine
c32f4c032a Fix: Child rows which were given as TR elements were not being added
- The child row feature of DataTables should be able to take a `tr`
  element and add that directly as a child. That wasn't working due to a
  logic error before.
2014-03-06 08:47:42 +00:00
Allan Jardine
6a568a7542 Fix: When invalidating data source, check the cells exist first
- Fixes the issue highlighted in thread 19822
2014-03-05 16:54:56 +00:00
Allan Jardine
ccc4f99c54 Dev: Remove debug 2014-03-05 16:54:21 +00:00
Allan Jardine
9a3bdacce6 Fix: IE8 - Settings as an API selector needs to return as an array 2014-03-04 08:53:08 +00:00
Allan Jardine
39828e8bab Fix: Incorrect use of offsetHeight for scroll collapse 2014-03-04 08:52:53 +00:00
Allan Jardine
a9687655ea Fix: Cell selector, when operating as a jQuery selector needs to return
an array, not a jQuery object - otherwise IE8- throws an error

- This fixes DataTables/DataTables #262
2014-03-03 10:19:21 +00:00
Allan Jardine
dcbea43baf New: column().visible() and columns().visible() now act as getters or
setters.

- See discussion thread 19653
2014-02-25 09:23:08 +00:00
Allan Jardine
4834aa26be Fix: If you had a column which has columns.visible:false set on it, it
would be removed from the array of data passed through to the custom
filtering functions. This would cause indexes to misalign.

- The fix is to simply pass in the data filter array that has already
  been computed, as that is 1:1 for the display. Also added the raw data
  source object for the row for completeness and a bit of a code tidy
  up.

- This will cause a bit of an indexing issue, if you have bVisible:false
  set, but this is certainly a bug that had to be fixed - it just didn't
  make sense as it was, and went against the documentation!

- See thread 19593 for more information
2014-02-21 17:20:32 +00:00
Allan Jardine
a14bfa29fb New: cell-selector type can now 'self-select' by supporting the index
objects that it uses internally for cells.
2014-02-21 17:20:20 +00:00
Allan Jardine
23c9580d01 Updating version to 1.10.0-beta.3.dev 2014-02-19 10:08:06 +00:00
Allan Jardine
7227353a8f Fix DataTables/DataTables #275 - Sort classes weren't being applied to
newly created elements

- The fix i've put in is basically the same as what DataTables 1.9-
  used. I had tried to opitmise it a little, but it wasn't working for
  newly created cells. I still think this can be optimised, but for the
  moment, this is at least allows it to work.
2014-02-19 10:07:21 +00:00
Allan Jardine
028a56051d DataTables 1.10.0-beta.2 2014-02-17 10:19:24 +00:00
Allan Jardine
6968422b42 Fix: Ajax callback function wasn't being called when server-side
processing was enabled (ajax.reload() and ajax.url().load())
2014-02-17 10:18:54 +00:00
Allan Jardine
c12b50daef Fix: A single space was being added to all cell classes on
initialisation
2014-02-17 10:18:42 +00:00
Allan Jardine
b36439b6b7 Fix: The externally exposed internal API methods were only exposed once
a DataTable had been intiailised.
2014-02-14 16:03:21 +00:00
Allan Jardine
9434d93956 Fix: Default cursor on paging disabled buttons
- This fixes DataTables/DataTables #272
2014-02-14 16:03:08 +00:00
Allan Jardine
7f9f954d99 New: eq() API method to reduce an API instance to just a single context
and result set for the plural methods.

Fix: Row details events were itterating over non-DataTables rows
creating a Javascript error

Fix: Example - Server-side processing row details example updated to be
able to restore the details row on a redraw.

Update: Documentation - Most examples which used `flatten()` are more
correct to use the new `eq()` method, so they have been updated.

- This set of changes is based on the discussion in thread 19377. While
  working on the fix, I realised that the use of flatten() is too broad,
  so the new `eq()` function is introduced. It is similar to the jQuery
  eq() method in that it reduces the instance to just the selected
  index, although in DataTables this is both the context and the result
  set. Its a small addition, but I think it will provide to be very
  useful
2014-02-11 11:04:50 +00:00
Allan Jardine
afdf67075d New: language.decimal option. This option can be used to tell
DataTables which character is used as a decimal place in the table's
data, so that number which are formatted using characters other than a
dot as the decimal place can be correctly detected and sorted.

- A large part of the world uses the comma as a decimal place, so it
  makes sense to have this option built-in directly to DataTables,
  rather than needing to use plu-in sorting types as before:
  http://en.wikipedia.org/wiki/Decimal_mark

- However, the decimal place character cannot be detected automatically
  since there are far to many ambiguities. As such, a new
  `language.decimal` option is defined which is passed through to the
  type detection functions. The type detection functions can then use
  that character to alter their detection functions to transform numbers
  into the dot formatted equivilent for parsing in Javascript.

- The numeric sorting methods have been bundled together in the function
  `_addNumericSort` which is called when a character is given for the
  decimal mark, adding the sorting functions required specifically for
  that mark. This means that any character at all can be added, while
  keeping the table's sort performance as it was.

- Code size in increased a little for this new feature, but a lot of
  work has been done to keep it to a minimum (while still optimising for
  the most common use case of a dot decimal place), and this is a good
  feature to have in DataTables' core code.

- All required documentation added and updated.

- Special thanks to Tobias Bäthge for suggesting and sponsoring this
  feature.
2014-02-10 17:07:22 +00:00
Allan Jardine
b007bbff00 New: Add thin space and narrow no-break space as supported thounsands
separators for formatted numbers
2014-02-10 17:06:41 +00:00
Allan Jardine
2665e8459d Dev: require() bash function now in the include file 2014-02-10 17:05:48 +00:00
Allan Jardine
6c3337e300 Site: DataTables 1.10.0-beta.1 blog post 2014-02-10 17:05:35 +00:00
Allan Jardine
87e0d43844 Fix: Column visiblity was using $().remove() to remove elements from the
DOM which results in any events attached being detached by jQuery. Need
to use `detach()`

- Thanks to sebgoe in thread 19360
2014-02-05 14:02:23 +00:00
Allan Jardine
b29fa07501 Fix: Possible column misalignment when scrolling is enabled
- This is caused due to different content in the displayed header and
  the size forcing header in the body scrolling table. The browsers can
  lay the two tables out differently even although the widths applied
  are identical, due to the different content.

- The fix is to keep the content in the scroll body header, but hide it
  by wrapping in a div which has height 0 and overflow hidden

- See thread 19311 for more information
2014-02-05 10:32:33 +00:00
Allan Jardine
2c4cc4fd1b New: Built in filtering will throttle calls to the server when using
server-side processing

- A popular plug-in for DataTables is the `fnSetFilteringDelay` plug-in,
  which provides a bit of a buffer when typing into the filter input so
  you don't make an Ajax request for every key stroke - i.e. don't DDoS
  your own server!

- Since we have _fnThrottle built in now for the scrolling, we can also
  use it to provide this buffering functionality for server-side
  processing filtering in the core. A couple of small changes for
  _fnThrottle were required to get the callback context correct and ot
  call it not immediately, but only after the delay
2014-02-05 10:32:21 +00:00
Allan Jardine
83f30cec8f Dev: Moving on to 1.10.0-beta.2.dev 2014-02-05 10:32:09 +00:00
Allan Jardine
7cea7a64b4 DataTables 1.10.0-beta.1 2014-02-04 10:44:37 +00:00
Allan Jardine
635f35a63b Merge branch 'master' of github.com:DataTables/DataTablesSrc 2014-02-04 10:44:23 +00:00
Allan Jardine
88c7044373 Site: Fix links 2014-02-04 10:44:10 +00:00
Allan Jardine
b670b5956b Update: jQuery 1.11.0
- Include jQuery in the repo build
2014-02-04 10:43:31 +00:00
Allan Jardine
eda09a9087 Dev fix: IE7 is throwing an error when using $().removeAttr() and
$().attr() for the aria sorting information
2014-02-04 10:43:17 +00:00
Allan Jardine
d65130ec4f Dev fix: row().node() should return null or the row element
- It wasn't with the registerPural API method because the function was
  returning undefined, which tells the wrapper to use the Api instance
2014-02-03 14:08:24 +00:00
Allan Jardine
2d3c29a9d5 New: Add no-footer class to the wrapper element when the table has no
footer

Update: Update CSS to display the table border properly when there is no
footer when scrolling

Dev: Update the _fnAddOptionsHtml function to be smaller in code size.
Identical functionality, just smaller code
2014-01-31 14:15:51 +00:00
Allan Jardine
9486f3ea02 Update: CSS - remove margin at the bottom ofhte table - it was causing
problems with the extensions which clone the table node. Rather the
margin is applied to the controls at the bottom of the table.
2014-01-31 13:27:55 +00:00
Allan Jardine
095d83e8c3 Dev fix: When x-scrolling, column widths were being overridden by the
fact that the table width attribute has been removed, but was being
applied to the table anyway, as 0px - causing the table to be as narrow
as possible. On the plus size, the columns kept their alignment with
such a misconfiguration! However, now the `width` option for columns is
correctly applied in x-scrolling tables.
2014-01-31 13:26:34 +00:00
Allan Jardine
61e23fb2fb Blog: 2014-01-24 - JS Bin updates 2014-01-31 13:25:55 +00:00
Allan Jardine
cea15987d3 Dev fix: Set the legacy.ajax option to null by default so you can tell
DataTables to specifially send the SSP params in the old or new format
2014-01-31 13:25:30 +00:00
Allan Jardine
3eeb09a06d Dev fix: Add ai to the list of Hungarian comapt options 2014-01-31 13:24:50 +00:00
Allan Jardine
ee4ee545d1 Dev fix: The table() method was truncating the exisiting object, it
should have been operating on a new object
2014-01-31 13:24:27 +00:00
Allan Jardine
e57b905431 Dev fix: Don't throw an error if passing in falsy information for the
settings object getter
2014-01-31 13:24:07 +00:00
Allan Jardine
47c82c52a7 New: Expose $.fn.dataTable.camelToHungarian as a static function which
can be used by plug-ins
2014-01-31 13:23:52 +00:00
Allan Jardine
e83eacff6d Dev: Update the column objects to store an index of the column so we
don't need to look it up with inArray. Also the header renderer does not
pass in the column index now (the column.idx property can be used). This
is to allow operations such as ColReorder to reorder teh columns and
still have the renderers update correctly
2014-01-31 13:23:35 +00:00
Allan Jardine
0e974f27e6 Dev: Add the ability to get a settings object from an API instance 2014-01-31 13:22:42 +00:00
Allan Jardine
d4bbef72ba New: AMD support - return the $.fn.dataTable object from the factory
function
2014-01-22 10:14:07 +00:00
Allan Jardine
9a462a5fe4 Dev fix: Child row appending was broken due to need to use .dt namespace 2014-01-21 08:19:39 +00:00
Allan Jardine
5267910596 Update: Modify the jQuery requires header to be 1.7 since we use
$().on()
2014-01-17 16:44:53 +00:00
Allan Jardine
df95820f84 Dev fix: Remove jQuery alias that was added in e6c076f.
- The correct way to use a different alias is changing the jQuery
  instance used in the factory builder
2014-01-17 08:51:06 +00:00
Allan Jardine
30f3abee21 Dev: Use jQuery to set the colspan / rowspan attributes
- This makes DT compatible with jscript
2014-01-17 08:50:53 +00:00
Allan Jardine
a854421f27 Dev fix: Correct error in aliasing the new ext.search to the old
afnFiltering interface
2014-01-16 11:30:51 +00:00
Allan Jardine
6fbd3ba8e6 New: Add the ability to read size information from HTML elements for columns
- Column width is always a particularly difficult one to get quite
  right. In this case, the fix is to have DataTables read column width
  information from the `width` or `style` attributes of a column header
  cell, if that information is present. If it is, it is treated as
  sWidth is (although user supplied sWidth can override). That is it say
  that it will be applied to the column width calculation table.

- The remaining gap is if a developer assigns a width using css classes.
  We can't get that information, so we fall into the old problem.

- This change comes about from the discussion in
  http://datatables.net/forums/discussion/19089 and the fiddle here:
  http://jsfiddle.net/EysLd/1/

- What is happening in the test case is that the calculation table is
  being created, but it is then stripped of widths due to this commit:
  https://github.com/DataTables/DataTables/commit/6a9e324 . That was to
  allow DataTables column headers to have their applied size removed, so
  a new size could be calculated. Only sWidth would override that - now
  the width and style attributes will as well
2014-01-15 16:19:03 +00:00
Allan Jardine
fe7d64e0ef Dev: API fixes for IE8-
- IE8- requires that Function.prototype.apply be used with an array or
  arguments object as the second parameter - it being "array-like" isn't
  good enough.

- This fixes DataTables/DataTables #262
2014-01-15 09:36:02 +00:00
Allan Jardine
96af1f5cf3 Merge branch 'master' of github.com:DataTables/DataTablesSrc 2014-01-14 15:51:06 +00:00
Allan Jardine
4c68d5881e Site: Disable comments on manual index page 2014-01-14 15:50:55 +00:00
Allan Jardine
ef974cb255 Dev: Trivial fix to use local variable for aoColumns 2014-01-14 15:49:41 +00:00
Allan Jardine
d60ddf211c Dev fix: Adding _fnCalculateEnd as a stub to the oApi object for
plug-ins

- A lot of plug-ins use _fnCalculateEnd and although all that is needed
  in the upgrade is to remove it, since the value is calculated
  automatically now, it will likely cause confusion and hassle. So I've
  added this stub to prevent those errors.
2014-01-14 15:49:03 +00:00
Allan Jardine
734607635a Merge branch 'master' of github.com:DataTables/DataTablesSrc 2014-01-14 15:47:45 +00:00
Allan Jardine
3bd9858e59 Merge branch 'master' of github.com:DataTables/DataTablesSrc 2014-01-14 15:47:33 +00:00
Allan Jardine
323e40e729 Site: Add documentation for tech notes 1-5. 2014-01-14 15:47:22 +00:00
Allan Jardine
2891978fd1 Fix: Numbers incorrectly detected as dates in Chrome
- Chrome (V8) will incorrectly detect '$245.12' and similar as dates,
  since V8 will strip unknown characters from a string given to
  Date.parse and then attempt to parse the rest of the string - in the
  example above: Dec, 245:
    https://code.google.com/p/v8/source/browse/trunk/src/dateparser-inl.h#72

- The fix implemented to to check for a leading a-zA-Z, number or +-.
  Although this isn't a perfect match for what Chrome does, it, I think,
  a good enough effort to chatch nearly all particular use cases.

- Additionaly, V8 will try to parse a single number passed into
  Date.parse - 1-12 are months, 32+ are years. As such, the numeric type
  detection much be a highter priority than the date detection, since
  Chrome might incorrectly use a column as a date. It would sort
  correctly, but it isn't "correct".

- The take away from this is that Date.parse cannot be used for date
  format validation on its own...
2014-01-05 11:18:42 +00:00
Allan Jardine
cd0139927e Dev fix: sInputFilter class wan't being applied when using the _INPUT_
macro

Fixes DataTables/DataTables issue #260
2014-01-05 11:18:31 +00:00
Allan Jardine
0b2c32c98f Merge branch 'master' of github.com:DataTables/DataTablesSrc 2014-01-05 11:18:18 +00:00
Allan Jardine
b3bd3cbda7 Site: Add documentation for tech notes 1-5. 2014-01-05 11:18:05 +00:00
Allan Jardine
4a65fb054a Update: isDataTable() static method will now accept jQuery objects and
selectors as a parameter to check if it is a dataTable.

`tables()` static method rewritten for size
2014-01-05 11:17:53 +00:00
Allan Jardine
1ab67a880f Fix: When in server-side processing mode, the processing display was
being removed too early on click to sort column.

- Fixed DataTables/DataTables 259
2014-01-03 09:56:57 +00:00
Allan Jardine
292d021217 Dev update: Better fix for flatten()
- Smaller code and works with a mix of scalars and arrays
2013-12-28 17:05:36 +00:00
Allan Jardine
e5d8a40fc1 Dev fix: The flatten() method should only flatten 2D arrays, and not
1D arrays.

- The method implemented isn't actually 100% perfect - if you mix arrays
  and scalars, then the behaviour is undefined. But that shouldn't
  happen in DataTables. Will look into it further, though
2013-12-28 17:05:11 +00:00
Allan Jardine
e699f8b510 Dev fix: ext.order is an object not an array
Dev fix: `ext.order` wasn't being aliased back to afnSortData correctly
2013-12-28 11:22:49 +00:00
Allan Jardine
dc0fffa316 Dev: Remove debug 2013-12-28 11:22:37 +00:00
Allan Jardine
4cb532ad95 Fix: DT_RowClass wasn't being updated when modified in the data source.
- This is actually a little more complex than it might first appear
  since any classes which have been added by DT_RowClass need to be
  removed. We can't just bindly remove all classes, so we need to track
  that classes have been added in a private variable.
2013-12-28 11:12:05 +00:00
Allan Jardine
ab13fcfcfd Dev fix: Add renderer as an initialisation parameter
- The core logic was already present, it just wasn't in the defaults or
  available to be set in the init object
2013-12-27 22:43:44 +00:00
Allan Jardine
f3a7f909bb Dev fix: Background row colour was only being used if the display or
stripe class was added.
2013-12-20 12:01:27 +00:00