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

174 Commits

Author SHA1 Message Date
Allan Jardine
8f356ab917 Dev fix: When no ordering was aplied to the table, the next order would
throw an error
2013-12-05 12:01:33 +00:00
Allan Jardine
1a317a07bf Dev: Update syntax core with /*! for closure to keep the licenses in
place
2013-12-04 17:11:21 +00:00
Allan Jardine
703ee53c47 Dev fix: API - destroy() was giving a JS error on scrolling tables
- http://datatables.net/forums/discussion/18584
2013-12-04 17:10:59 +00:00
Allan Jardine
c8a69545e0 Dev - fix examples: Data source examples had a couple of data source
errors
2013-11-29 12:21:19 +00:00
Allan Jardine
d0a0ef8ad1 Dev fix: $.fn.dataTable and $.fn.DataTable should both have the same properties available
- This fixes DataTables/DataTables issue #241.

- Most of the properties attached are objects, so we want the references
  to them, rather than a copy, so a simple assignment is all that is
  needed. Strings etc will continue to work as well.
2013-11-29 11:59:43 +00:00
Allan Jardine
d4a1028a1d Dev fix - Full backwards compatiblity with fnServerParams with array
syntax paraneter names

- Data added using fnServerParams with array syntax had different
  behaviour in 1.10 from 1.9. In 1.9 jQuery would create an array for
  us, but in 1.10 before we create an object first, we need to create
  that array ourselves. So the following code had different behaviour:

		"sAjaxSource": "data/arrays.txt",
		"fnServerParams": function ( d ) {
			d.push(
				{name: 'somekey[]', value: 'somevalue1'},
				{name: 'somekey[]', value: 'somevalue2'}
			);
		}

In 1.10 it would have sent `somekey[] = somevalue2` but 1.9 would have
sent both as part of an array.

To maintain full compatiblity with 1.9 we need to convert this syntax to
an array - this commit does that.

I was concerned about using parameters in the brackets, but jQuery only
searches for `[]` when performing this conversion. We could use $.param
and then decode the created query string, which would be absolutely 100%
comaptible, but would involve additional code and I think this method
provides that 100% compatiblity from reading the jQuery code), and its
shorter.
2013-11-29 11:36:03 +00:00
Allan Jardine
19f5d9a157 Dev fix - example: Use camelCase in the examples - 18448 2013-11-25 16:57:39 +00:00
Allan Jardine
89c3ded42a Dev fix: Examples - Index column example needs to use namespaced events 2013-11-25 09:24:08 +00:00
Allan Jardine
208b3ba6a1 CSS: Add border-spacing: 0 to the stylesheets
- This is the CSS version of the cellspacing attribute on the table in HTML. It will work in all browsers except IE6/7. IE8+ and the others are all fine. So for the moment most of my examples will continue carrying the cellspacing attribute, but this is useful to have in the core css
2013-11-25 09:23:57 +00:00
Allan Jardine
667ee39fdb Dev fix: DataTables/DataTables #250
- Need to namespace custom DataTables events in 1.10
2013-11-25 09:23:35 +00:00
Allan Jardine
4549646891 Dev fix: Sort indicator items weren't being redrawn
- Confusion aorund the `order` and `sort` events which resulted in the
  sort icons not being updated
2013-11-21 13:46:17 +00:00
Allan Jardine
7a32f2db93 API: Column selector - add support for visible indexes counting from the right
- The ability to use negative numbers as a column selector for the
  column data index was added recently, but that didn't include the
  ability to work with negative numbers with the :visible pesudo
  selector. This commit adds that ability so you can do:
  `table.column("-1:visible")` to always get the right most visible
  column
2013-11-19 13:55:08 +00:00
Allan Jardine
32e27fcc2f Api: Column selector - jQuery selector as a string, an name selector
with :name postfix.

- Previously you could use a jQuery selector for columns by using the
  :jq postfix, and names were matched otherwise. This is reversed now
  for consistency with the rows and cells selectors which treat strings
  as jQuery selectors without the :jq postfix.
2013-11-19 13:54:53 +00:00
Allan Jardine
e82068e7b3 Dev fix - incorrect fix for the API extend method before. Was looking
its own reference
2013-11-19 13:54:41 +00:00
Allan Jardine
6740193eed Dev fix: The API chaining was a little broken if the inner function
returned undefined, null etc.

- The base issue was in the instanceof check which has a priority error,
  it was:
    ! obj instanceof _Api
  which is the same as:
   (! obj) instanceof _Api
  which is rubbish.

  We want:
    ! (obj instanceof _Api)
  but there is of course a wrapper function, so that needs ot be taken
  into account as well. The new logic does just that.
2013-11-19 13:54:14 +00:00
Allan Jardine
8919616833 Docs: row() and rows() API documentation 2013-11-19 13:54:02 +00:00
Allan Jardine
8dcdb94b15 API - invalidate() methods - add an "auto" option that can be passed
rather than jsut an empty string as auto
2013-11-19 13:53:48 +00:00
Allan Jardine
48fd750bd8 Fix: Initialisating multiple DataTables with a single call was broken
- Because of the manipulation of the initalisation object initialisation
  of multiple tables with a single jQuery call (i.e.
  `$('.dataTable').dataTable();`) was broken since the second table
  would see the modified init object. Need to take a coopy of the object
  before entering that state.

- This could probably do with a bit of a clean up sometime...
2013-11-19 13:53:36 +00:00
Allan Jardine
ba2fb9f315 Fix - examples: Same id twice on the page breaking things 2013-11-19 13:53:25 +00:00
Allan Jardine
8a5712b7e9 Update - init options: Rename displayLength to pageLength for consistency
- The displayLength option is poorly named, particularly with the new
  API refering to it as the page length (page.len()) so, using the new
  translation option to allow backwards compatiblity while using new
  parameter names, I've updated this parameter's name and its
  documentation.
2013-11-18 13:43:58 +00:00
Allan Jardine
7119dfa50c API: Selectors - 'filter' selector modifier renamed to be 'search'
- Renaming in keeping with the new terminology
- Updating example which uses it (main documentation still to be
  written)
- Backwards compatible with a bit of logic to check if the old version
  is being passed in
2013-11-18 13:43:46 +00:00
Allan Jardine
d47da33826 Old API: Mark $ method as deprecated 2013-11-18 13:43:34 +00:00
Allan Jardine
a423c0f457 API - dev: Remove the plugin() methods from the new API
- Decided that it would be better to provide the new API by having
  plug-ins extend it directly, rather than providing their own API.
  Using the plugin() method it was possible to get a plug-in insta,ce
  for example TableTools, but the way it should work is that TableTools
  would provide a tabletools() API method, registering it as an
  extension to the DataTables API objects. Further more, TableTools
  should provide methods such as row().select() etc, extending the
  current API rather than doing its own thing which the plugin() methods
  prompted.

- No backwards compatiblity issues here as the plugin() code hasn't
  shipped as a release.
2013-11-18 11:46:39 +00:00
Allan Jardine
cf8f008a4d Dev - examples: Update the example code to take account of the event
changes from: ae0951b, 694f129 and 1f561e3
2013-11-18 11:46:27 +00:00
Allan Jardine
635a027057 Dev: Remove the static construct method that had been added as part of 1.10
- I added a static DataTable.on() method previously in the 1.10
  development for a single event called `construct` which would tell us
  when a table was constructed. But I've realise that since the events
  that DataTables' triggers bubble up through the document, that effect
  can already be achieved:

- Use:
  - $(document).on( 'init.dt', function ( e, settings ) { } );

- Rather than:
  - $.fn.dataTable.on( 'construct', function ( settings ) { } );

- No backwards compatiblity issues as the DataTable.on code was never
  shipped, its dev code only
2013-11-18 11:46:15 +00:00
Allan Jardine
0f18491cf1 New: Warning on generic Ajax error (404 etc)
- Previously DataTables would only show an error message if there was a
  JSON parsing error. However, if there was any other kind of error,
  such as a 404, it would just silently swallow the error. THink its
  best to show an error and a tech note.
2013-11-18 11:46:04 +00:00
Allan Jardine
6dcc69ee54 New: DataTables events are now all bound to the .dt namespace
- This is a breaking backwards incompatible change - please be aware of
  this!

- DataTables fires custom events such as `draw` etc, but these events
  were in no way identifyable as eminating from DataTables rather than
  some other component, which can cause confusion and difficulty
  resolving bugs.

- As such, all DataTables events are now fired with the `dt` namespace -
  this means if you are currently using events, you must update your
  code to also use the .dt namespace. If you are already using
  namespaces, that's great, you can continue to do so as jQuery allows
  multiple namespaces, but you must still use the .dt namespace.

- This is a breaking change because the old behaviour was incorrect -
  i.e. this was a bug to be fixed, hence why we haven't gone through a
  deprecation cycle. The old events weren't well documented (only in the
  JSDoc generated docs and a few of my forum posts), whereas in 1.10
  they will form a key part of the documentation. As such, now is the
  time to get this right. This will be documented clearly in the upgrade
  notes.

- Discussion on this topic here:
  https://github.com/DataTables/DataTables/issues/245
2013-11-18 11:45:41 +00:00
Allan Jardine
ed4afe6178 Api: Column selector - add the ability to select columns counting from
the right by passing in a negative number
2013-11-14 17:21:48 +00:00
Allan Jardine
48931bbb18 Api - columns: Corrections found durating documentation:
- columns().cache() should check for the parameter 'search' for naming
  consistency

- Plural error on column().nodes()

- Change column.index() fromIndex/toIndex to fromData/toData - its an
  index be it data or visible, so the old method was meaningless
2013-11-14 17:08:24 +00:00
Allan Jardine
debea960c6 Api fix - cache() method should look for 'search' as the passed in
parameter
2013-11-14 17:08:10 +00:00
Allan Jardine
5c9d54e6f5 Api: table().header() and table().footer() methods for naming consistency
- The columns() methods have header() and footer() children to get the
  header and footer cells for the columns. For naming consistency the
  table() methods should be named likewise
2013-11-14 17:07:57 +00:00
Allan Jardine
b956a69271 Fix - API: Errors in plurals and signular forms of method naming 2013-11-13 16:22:04 +00:00
Allan Jardine
7cf5f904d8 New: Api methods - to$, toJQuery and join
- to$ - Convert the result set to a jQuery object. Compliment to the
  toArray method. This is mainly useful when working with the node() and
  nodes() methods.

- toJQuery - Alias of to$

- join - Array join method
2013-11-13 16:21:52 +00:00
Allan Jardine
da8358ce48 Updated: Update examples and documentation for the change in committed
in cdc6399 to make naming more consistent
2013-11-12 19:18:51 +00:00
Allan Jardine
e1f0fd2dee Updated: Naming consistency for searching and ordering
- With the new API the filter() and sort() methods already have meaning
  (the array methods built into Javascript) so the methods for filtering
  and sorting in the API are called search() and order() respectively.
  However, the intialisation parameters and events in DataTables use a
  mix of filter, search, sort and order in their terminology so this
  commit harmonises on just search and order, updating where
  appropriate.

- There are a number of incompatible changes if you are already using
  the new options in 1.10, but no incompatible changes to the latest
  release (1.9.4). 1.10 changes:
    - Server-side processing, the new parameters sent have been updated
      to refelect the new terminology
    - The Ext object likewise has been updated

- Default with the old options and padding int he old options will still
  work as before, compatiblity functions have been added to provide
  mapping. If both are provided the new parameter value will take
  president.

- The change is primarily around `sort` since that was reasonably
  consistent in its terminology for the initlaisation parameters before.
2013-11-12 19:18:40 +00:00
Allan Jardine
46c5884853 Examples: Update footer callback with use of column().footer() 2013-11-12 19:18:29 +00:00
Allan Jardine
c8d2ebedc1 Merge branch '1_10_wip' of github.com:DataTables/DataTablesSrc into 1_10_wip 2013-11-12 19:18:18 +00:00
Allan Jardine
8c2c65c9dd New: Cached footer cells can now have colspan properties, allowing
column index referencing of the cells.

- Previously a colspan in a footer cell would cause index misalignment -
  for example if you had a table of 6 columns with two in the footer
  (one colspan=5) the fotoer cells would be assigned to the first two
  columns in the table, breaking column index order. Now a cell can be
  used over multiple columns. This allows column().footer() to always
  reflect the cell that belongs to that column (possibly sharing it with
  other columns).

- Note that the footer will only use cells from the first row in the
  footer. If there is more than one row, use table().foot() to access
  the TFoot element and then manipulate it as needed.
2013-11-12 19:18:06 +00:00
Allan Jardine
ad973fec36 Fix - docs: Error in examples for xhr event 2013-11-12 19:17:54 +00:00
Allan Jardine
d389c6d348 Docs: Event docs in the new XML format for the web-site 2013-11-12 19:17:31 +00:00
Allan Jardine
a287b560b8 New: Add built-in support for percentage numbers 2013-11-12 19:17:18 +00:00
Allan Jardine
45f9be18ed Docs: Complete the XML docs for the top level DataTables options 2013-11-12 19:16:40 +00:00
Allan Jardine
87832058d4 Docs: More documentation of the options 2013-11-12 19:16:28 +00:00
Allan Jardine
90599e45a6 Docs: Further documentation of the options DataTables has available 2013-11-12 19:16:15 +00:00
Allan Jardine
9eb7164152 Fix: On pages which use *{box-sizing:border-box} scrolling would break
- The fix here is to set the box sizing for the table and its cells to
  be content-box sizing to allow the column width calculations to occur
  correctly - 17932
2013-10-24 13:20:13 +01:00
Allan Jardine
fd550de897 Update file header to use minifier friendly copyright header
- JSDoc comments still exist, but the information is to some degree
  duplicated.

- Copyright header matches what is used in the minified script now
2013-10-19 19:01:34 +01:00
Allan Jardine
6b7761100f Packaging: Change composer.json descrptor name to use lower case
- Packagist requires that packages use only lowercase letters in their
  name (although the composer spec says nothing about this), so in order
  to make DataTables usable with packagist we need to change the name
  slightly.
2013-10-17 10:56:50 +01:00
Allan Jardine
fd91aba00c Examples: Add HTML5 data-* attribute example
- DataTables 1.10 has the ability to source data for filtering and
  sorting from HTML5 data-* attributes. This example shows that ability
2013-10-16 15:33:34 +01:00
Allan Jardine
62aef83013 Examples - Add initialisation code, HTML and other information to
display

- In the examples we want to show the following information to help
  developers to get to grips with DataTables more readily:
    - Init javascript code
    - HTML used for the table
    - Additional CSS used
    - Ajax loaded data
    - List of the libraries files loaded in the example

- All but the last point is complete, a bit of styling and information
  text.
2013-10-16 12:03:14 +01:00
Allan Jardine
6c10109119 Dev: Update JShint file for JShint 2.1 and apply fixes from errirs it
spotted
2013-10-15 15:31:45 +01:00
Allan Jardine
c916bb05fe New: search() and column[s]().search() API methods now have a 'get'
option

- By passing in no parameters to the search API methods we can get the
  current search value - for example:
      $('#example').DataTable().search();

- This is to round of the API as the order() method already has a get
  option as to the paging information
2013-10-15 15:31:35 +01:00
Allan Jardine
ecd36146e9 Examples - update server-side processing examples for new data
New: Server-side processing scripts rewritten to use PDO and use a class
with static functions for code sharing between all examples.
2013-10-15 14:40:19 +01:00
Allan Jardine
c9c8e65708 Updated - server-side processing support for camelCase variables
- As part of the 1.10 move to camelCase the server-side processing
  return now accepts camelCase variables as well as the old 1.9
  hungarian notation.
2013-10-14 17:33:54 +01:00
Allan Jardine
a70f109ac4 Dev - code regoranisation for new methods
- Variables and functions which are to be private in DataTables, but
  available across all files have a single leading underscore.

- Variables and functions which are to be private in a single file have
  two underscores (but no self executing function to restrict scope as
  that will just take extra space).

- Externally exposed functions and JSHint globals list updated
2013-10-14 14:06:09 +01:00
Allan Jardine
fa5b99a586 Update exposed functions list 2013-10-14 14:06:00 +01:00
Allan Jardine
686b9c9b72 Size: Refactor _fnBrowserDetect slightly to reduce size a small amount 2013-10-11 17:31:33 +01:00
Allan Jardine
a9035942d0 New - API: plugin(), plugin.register() and plugin.deregister() methods
- When working with plug-ins such as TableTools, there is no clearly
  defined way at the moment to get at the plug-in instance, with each
  doing it its own way (TableTools as a static function, while Scroller
  attaches itself to the settings object and KeyTable is its own
  intialiser, amoung others...) so I'm introducing these methods to
  unify this.

- plugin() is used by DataTables users to get their plugin instance, for
  example `table.plugin('tabletools')` would get the TableTools
  instance allowing full access to its API.

- plugin.register() and plugin.deregister() are called by the plug-ins
  when they attach themselves to a DataTable. The 'extras' will all need
  to be updated to use this new method.
2013-10-11 17:19:10 +01:00
Allan Jardine
846c4d9c60 New - API: Static on() method, which listens for static events from DataTables
- Some plug-ins would benefit from be able to automatically initialise
  when a DataTables is constructed, to this end, a construct for static
  events is added here, with the static function $.fn.dataTable.on()
  listening for events. Currently only the `construct` method is
  available, although others could potentially be added in future if
  they are useful. As such, the code driving it is intentionally simple
  for this cas,e but the API abstract enough to allow future expansion.

- There is no `off()` method, as I'm not sure it would be that useful.
  Could be added in future if needed!
2013-10-11 16:09:30 +01:00
Allan Jardine
4e05760b20 New: Add callback function to the ajax.url().load() and ajax.reload()
methods
2013-10-11 16:09:19 +01:00
Allan Jardine
8f975060d8 New: Server-side processing parameters update
- The server-side processing parameters used by DataTables 1.9 are very
  ugly, and rather arkward to work with, so in keeping with the
  camcelCase approach of 1.10 and its general monderisation, when using
  the `ajax` option to set the ajax url for data, DataTables server-side
  processing will now use a much more modern method of telling the
  server what data is required - specifically using arrays and objects
  in neatly formatted data.

- The old 1.9 method is invoked if sAjaxSource is used to set the ajax
  url, or if $.fn.dataTable.ext.legacy.ajax is set to true. As such,
  this change should be fully backwards compatible since `ajax` is a new
  option in 1.10.

- This new ability adds 334 bytes to the min file, primarily, because
  the old method is retained (using just the new method would actually
  reduce the size slightly).
2013-10-11 15:39:54 +01:00
Allan Jardine
9d642814cc Size - refactor Ajax server-side processing parameter builder 2013-10-11 14:22:10 +01:00
Allan Jardine
3e0637f910 Dev: Fix type in last commit 2013-10-11 14:22:00 +01:00
Allan Jardine
c3a2ad6f40 ize - refactor _fnInitialise for size. Only about 60 bytes saved 2013-10-11 14:21:49 +01:00
Allan Jardine
5c0cdd86cd Size - refactor sizing functions to reduce file size and modernise code
- The _fnCalculateColumnWidths is probably the oldest function in
  DataTables which has mostly reamined as it was 5 years ago! However,
  its time to trim it down a bit and optimise now. This rewrite has all
  the same actions, but results in a minified file which is about 700
  bytes smaller than before.
2013-10-11 14:21:38 +01:00
Allan Jardine
920b7671fb Dev fix - Broke non-scrolling tables with the scrolling refactor 2013-10-11 09:48:22 +01:00
Allan Jardine
70a3f88d8d Dev - tidy up changes 2013-10-10 17:47:11 +01:00
Allan Jardine
b178ab69a2 Removed - bAutoCss and refactor scrolling functions for size
- The bAutoCss parameter is not one that I've ever actually seen used,
  so I've dropped it out here to reduce complexity. It was only useful
  for making the scrollbars always visible on the table, which can just
  as easily be done with `div.dataTables_scrollBody { overflow: scroll
  !important }` since that will take a heigher priority that the
  DataTables appled style.

- The moster _fnFeatureHtmlTable and _fnScrollDraw functions have been
  refactors, saving around 1.5K in size (in the minified file)
2013-10-10 17:46:59 +01:00
Allan Jardine
fb2f40a455 Removed: bScrollInfinite and iScrollLoadGap
- The infinite scrolling feature of DataTables is inadequate as a
  solution for the problem it is trying to solve as it introduces a
  number of compatiblity issues with the rest of the API parimarily
  due to the fact that it "tricks" the rest of DataTables into drawing
  just a small proportion of the table, leaving the elements which are
  currently in place. This means that DataTables doesn't realise that
  the table has additional rows at the top of the table, thus breaking
  numerous interactions with the API and confusing developers. As such,
  its a poor feature that is just taking up space and could be done much
  better externally.

- I will write an infinite loading feature for DataTables in future for
  users that do what to use this ability - there is nothing stopping a
  simple scroll event being attached to the scrolling element and
  calling the rows.add() function. This is exactly what the new plug-in
  will do.

- Scroller is a much better solution for defined length tables.
2013-10-10 17:46:48 +01:00
Allan Jardine
c31d3a1447 Dev: Refactor the filtering HTML creation function - save 138 bytes on
file size
2013-10-10 17:46:36 +01:00
Allan Jardine
3795134856 New: Default Ajax source property updated to be data
- In keeping with the camelCase name changes for DataTables 1.10, the
  default Ajax data source object property name has been updated from
  `aaData` to just `data`. Note that this is a fulyl backwards
  compatible change - if aaData is present in the data, it will be used.
2013-10-10 17:46:26 +01:00
Allan Jardine
fe1a5a630a Dev examples - Update ajax examples for new data and improved
descriptions
2013-10-10 17:46:15 +01:00
Allan Jardine
c470d7bfda New: sFilterInput and sLengthSelect class options for the <select> and
<input> controls used by DataTables for length change and filtering
respectively.

- Bootstrap 3 requires a styling class be set directly on the element,
  so in order to correctly support Bootstrap 3, which we want to do, we
  need to have the ability to set these classes. This commit adds that
  ability
2013-10-09 14:57:45 +01:00
Allan Jardine
bef8374eed Dev fix: Sorting a filtered table was broken
- Because of the decoupling of the filtering and sorting, the filtering
  was missing that the indexes of the displayed data will have changed
  after a sort. So need to do a full filter when just sorted
2013-10-09 14:57:34 +01:00
Allan Jardine
8debb87477 Dev examples - update bootstrap and foundation examples for example
styling

- Note that I've included the bootstrap and Foundation integration files
  in the resources folder. In future these files will be on the CDN, but
  that isn't up and running yet...
2013-10-09 14:57:23 +01:00
Allan Jardine
a11eb6d696 Dev fix: Error in full pagination type - missing first and last
buttons
2013-10-09 14:56:24 +01:00
Allan Jardine
6bd699b537 Dev fix: iDataSort and aDataSort conflicting on camelCase
- Simple fix is to check if it is a number or not
2013-10-09 14:56:12 +01:00
Allan Jardine
8573d5955c Update - init: scrollX can be set as true
- scrollX was often the source of frustration when setting it to
  anything other than "100%", which is was in the demos and
  documentation but it makes it easy to see that you could set it to be
  50% or anything else. That usually broke the developer's layout. So
  now you can just use scrollX: true, to enable horizontal scrolling.
  The demos have been updated for this.
2013-10-09 14:56:01 +01:00
Allan Jardine
888c4374e8 CSS: Automatically clear the DataTable wrapper element
- A numebr of support requests are about why the layout immediately
  after a DataTable looks wrong, and its usually because of the floats
  used by info / paging, so we self clear the wrapper around the
  DataTable controls
2013-10-09 14:55:24 +01:00
Allan Jardine
cdae9014de Dev - build process - examples
- Updating the build process to introduce the example builder to convert
  the XML example files into HTML files. This process is performed for a
  number of reasons:

  - Much more maintainable - links automatically updated
  - Add / remove examples easier
  - Modify page styling easier
  - Examples can be directly integrated into web-site since they are
    transformed by template
  - Common data sharing

- Note that the work on the new example build process is not complete in
  this commit, there are still a few things to do! css, media paths and
  completing the templates.
2013-10-09 14:55:01 +01:00
Allan Jardine
76ae8661c8 Dev: JSON API - store and return the original JSON object
- Rather than creating a new JSON object from the XHR, use the one that
  was returned by the server. This is useful if you manipulate the data
  since you want to just keep using the same object.
2013-09-23 11:45:23 +01:00
Allan Jardine
7c1d27ae5f Dev fix: HTML-5 attr detection could provide undefined functions
- The HTML5 attribute detection for sorting, filtering etc was breaking
  if you didn't provide a filtering _and_ sorting attributes since they
  created an undefined get data function, which causes DataTables to
  complain. Fix is to just check for a null value.
2013-09-23 11:45:14 +01:00
Allan Jardine
5a3401ee5b Fix: Add support for the input, paste and cut events in the filter input
- IE10 has a little `x` to clear text boxes which fires the `input`
  event, so we need to monitor for that in the filtering input.

- While I'm here, I've also added support for the paste and cut events
  to change the filtering when they fire. Via keyboard the fire on
  keyup, but not if you use the mouse. They do now.

- Not that it us possible to have multiple events fire (keyup + paste
  for example). The logic of checking for a change of input counters
  this.

- Thhis fixes DataTables/DataTables issue #227.
2013-09-23 11:45:06 +01:00
Allan Jardine
4e5cad9640 Size: The default formatNumber method has been reduced in size.
- Exactly the same functionality, but now uses a regex to perform the
  same operation
2013-09-23 11:44:58 +01:00
Allan Jardine
e61e402e37 Performance: On destroy, don't select tbody elements for event removal
- Based on thread 17024 - if you have a large table with a lot of
  elements in the tbody, the find('*') selector was of course selecting
  them all. That results in poor performance. DataTables doesn't add any
  events to the children in the tbody, so we can filter out those
  elemetns and keep the element list ot  a sensible size.
2013-08-23 10:11:42 +01:00
Allan Jardine
4d6081c3d2 Performance - HTML decode uses DOM directly rather than jQuery to speed things up
- Based on the discussion in forum thread 16961 and the results from
  http://jsperf.com/html-decode I've updated how the HTML decode for
  filtering is done to bypass jQuery and use DOM methods directly. It is
  more code but it is also much faster.
2013-08-22 09:30:02 +01:00
Allan Jardine
74a78b2010 Accessibility: Add live region attribute to table info, remove from table
- Based on feedback from Rich Caloggero in forum thread 13421 the ARIA
  live region DataTables was adding to the TBODY element of the table
  have been moved to the table information element, so screen readers
  don't go mad announcing the new informaiton in the table on every
  change, but rather just read the summary.
2013-08-20 15:58:38 +01:00
Allan Jardine
5ca931c23b Fix: null handling for type detection and filtering methods
- The built in filtering formatters and type detection need to be able
  to handle just about any data being passed into them. They were
  tripping up with null data being passed in before.
2013-08-20 15:01:51 +01:00
Allan Jardine
a798d53d17 Merge branch '1_10_wip' of github.com:DataTables/DataTablesSrc into 1_10_wip 2013-08-20 15:01:34 +01:00
Allan Jardine
e6840bd2cf New: Pagination language options (i18n) have _PAGE_ and _PAGES_ options
- Based on the discussion in forum thread 16938 DataTables now has the
  ability to use _PAGE_ and _PAGES_ in addition to the exisiting
  _START_, _END_, _MAX_ and _TOTAL_ options in the information language
  strings. This allows the developer to show paging information rather
  than record based information in the information element.
2013-08-20 15:01:25 +01:00
Allan Jardine
425eb38c5b Dev fix: API page.info().page should use 0 as the start index not 1
- Math.floor should be used to have page indexes starting at 0 rather
  than 1, since page(n) uses 0 based indexing.
2013-08-20 15:01:17 +01:00
Allan Jardine
e1f4a8fa9e Use named module for AMD include
Based on DataTables/DataTables/issues/214 this commit uses the optional id parameter for the AMD define function to give DataTables a 'name' for easy referencing.
2013-08-20 15:01:10 +01:00
Allan Jardine
d5eb393df9 New: DataTables tables resize automatically with window (and width="100%" attr)
- DataTables tables previously did not automatically adjust their sizing
  when the window width was changed, which let to a lot of additional
  calls to fnAdjustColumnSizing in peoples code (and support questions
  in the forums). This commit add adjustment to the sizing automatically
  for tables width have width="100%" as an attribute (we can't use CSS
  since we can't know if it is relative or absolute sizing) - extending
  what went before. This has full compatiblity with scrolling and
  non-scrolling tables. A throttle is used to not bring IE to its
  knees...
2013-08-14 12:15:18 +01:00
Allan Jardine
b00180b71e Dev fix: fnAdjustColumnSizing was reseting paging
- The shim layer call to api.draw() was telling the API to reset the
  paging, but it should have been holding it static (as it now does by
  passing false in to draw()).
2013-08-14 09:07:15 +01:00
Allan Jardine
c05d26fcb9 Dev fix: Spell _unique correctly in ext! 2013-08-09 12:06:43 +01:00
Allan Jardine
cbeaadcba8 Dev fix: Additional to the content-box fix form the other day - use
jQuery since browser specific styles can override the W3C option. jQuery
deals with it for us.
2013-08-08 14:51:51 +01:00
Allan Jardine
dd805f6623 New: CSS - Add .selected option to CSS for selected rows
- It is quite common to have a row selection styling in DataTables, so
  it makes sense to built this ability directly into the core CSS. It
  doesn't add too much extra weight, but it would be a huge pain for
  developers to do themselves and also it means I can reuse it in
  TableTools / Editor.
2013-08-06 17:18:56 +01:00
Allan Jardine
4c317c910a New - event - column-sizing - fired when the column sizing chages
- This event allows plug-ins (specifically FixedColumns in this this
  case is what I'm thinking of, but others such as FixedHeader could
  also benefit) to alter their layout when the column sizing is changed
  (for example by a window resize).
2013-08-06 10:26:05 +01:00
Allan Jardine
ac7fb22620 New: New event - column-sizing - fired when 2013-08-06 10:25:57 +01:00
Allan Jardine
f817e9a0be Dev fix: State saving was breaking on sort
- My fix a while back for detecting if a column was no longer available
  in a table was duff, since it used $.map which flattens its array
  return, but sorting needs a 2D array.

- Fixed by doing our own itteration
2013-08-06 09:08:10 +01:00
Allan Jardine
6447373eb6 Dev fix: Update filter formatters to deal with null / undefined data 2013-08-05 15:40:50 +01:00