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

913 Commits

Author SHA1 Message Date
Allan Jardine
fa7122392d New: tables() and tables().nodes() methods for the new API:
- tables() is a table selector and iterator that most other API methods
  will likely use.

- tables().nodes() gets the selected HTML table nodes.

- Documentation of these functions is rather incomplete. Not yet sure
  how to fully document them. Currently thinking of having seperate
  documentation, a bit like jQuery, which can be a lot more involved,
  rather than building it fromt he doc comments which might get rather
  long (they already are!).
2013-04-17 14:35:15 +01:00
Allan Jardine
e9176bee48 New: First commit for the new Api.
- This commit introduces the new Api core, a 'class' which is a data
  helper and DataTable control interface. Methods of this class are
  designed to be chainable (although it is not manditory - some can
  return boolean values if needed).

- The core data helper functions are present in this comment, although
  not yet fully documented. That will come as the Api stablises and I'm
  happy with the structure.

- There are no table control methods yet - coming soon.
2013-04-16 16:38:53 +01:00
Allan Jardine
b1d88c1c91 Performance: Read the style.width property for the restore width and
apply that.

- This is much faster than the previous method of using $(this).width()
  since there is no longer an invalidation and getComputedStyle
  calculation. It just uses the value that is available in style.width,
  which might very well be empty (if the style attribute is used with a
  width property defined is it not empty).

- This also improves accuracy since it is the original that is restored,
  and not the calculated size.

- See http://datatables.net/forums/discussion/14811 for the discussion
  for this change.

- Thanks to `krzycho` for the discussion and suggestions.
2013-04-06 09:44:52 +01:00
Allan Jardine
ad0e08585f Performance: Width of scrollbars isn't going to change on a single page
between table's being reinitialised, so calculating the scrollbar width
every time is a real hit on performance since it needs to manipulate the
DOM. This change ensures that the calculation is performed only once.
2013-04-06 09:36:44 +01:00
Allan Jardine
182998a7c5 Fix: Remove pointer cursor from cells which cannot be sorted - 14826 2013-03-29 07:27:47 +00:00
Allan Jardine
5a0c1f5ac6 Fix #168 - fnInitComplete should give json as second parameter as well
- When server-side processing is enabled, fnInitComplete will now be
  passed a second parameter, the json returned from the server for that
  first draw, matching the Ajax data source with client-side processing
  option.
2013-03-27 09:25:55 +00:00
Allan Jardine
baa16632ec New - licensing: DataTables is now available under the MIT license
- Full license available here: http://datatables.net/license_mit

- Note that this effectively makes the BSD and GPLv2 licenses that
  DataTables is also available under redundant since the MIT is the most
  relaxed of these licenses. At some point in the not too distant
  future, it would make sense to remove these two licenses and have
  DataTables available under only the MIT license.
2013-03-15 09:56:27 +00:00
Allan Jardine
8d9e620ef2 Merge pull request #160 from zeitiger/master
Refactor filter search from input[text] to input[search]
2013-03-04 02:42:57 -08:00
David Steinkopff
c2dd657fa8 remove hacking 2013-03-04 08:43:11 +01:00
David Steinkopff
8efdd92a46 Merge branch 'master' of https://github.com/zeitiger/DataTables
Add requested changes
2013-03-04 08:38:31 +01:00
Allan Jardine
b87187fc5b Fix #162 - Flexible width is width="100%" is applied as attribute to the HTML table
- Attach an event handler to the window to resize the table. Note that
  this isn't debounced - possibly it should be in future(?), but don't
  want to add the additional code required if it isn't required. It
  seems to function perfectly well for me!

- Unbind needs to unbind by the instance unique reference since there
  might be multiple tables listening for the event.
2013-03-03 12:03:44 +00:00
Allan Jardine
25eaa86477 Dev fix: Typo in the name of _hungarianMap private parameter 2013-03-03 08:36:58 +00:00
Allan Jardine
2bd643468b New: Extend render option to use objects allowing different data to be
used for the different data types very easily.

- Until now, if you want to use different data for the different data
  types (I've called these orthogonal data in relations to DataTables)
  you had to specify a function. That's fine, but it seems a rather
  clumsy way of just pulling different data out of a source object based
  on the type. This method allows the data types to be very easily
  defined with an object, allowing the same rules as `render` normally
  does (dotted object notation, array notation etc).

- For example:

    $(document).ready(function() {
    	$('#example').dataTable( {
    		columns: [
    			{ data: null, render: {
    				_: 'a',
    				sort: 'c',
    				type: 'c',
    				filter: 'd'
    			} },
    			{ data: 'b' }
    		],
    		data: [
    			{ 'a': 1, 'b': 2, 'c': 4, 'd': '1' },
    			{ 'a': 3, 'b': 4, 'c': 3, 'd': '3' },
    			{ 'a': 5, 'b': 6, 'c': 2, 'd': '5' },
    			{ 'a': 7, 'b': 8, 'c': 1, 'd': 'allan' }
    		]
    	} );
    } );
2013-03-02 18:53:27 +00:00
Allan Jardine
079a1f2e1d Fix: remove tabindex from clone header nodes
- Tabbing through a scrolling table the tabindex on the cloned header in
  the body part of hte table meant that the browser would focus on those
  elements. Fix is to remove the tab index from the clone nodes.
2013-03-01 17:30:40 +00:00
David Steinkopff
9b003e6690 replace input[text] with HTML5 input[search] 2013-02-28 10:26:45 +01:00
David Steinkopff
4577a52056 replace input[text] with HTML5 input[search] 2013-02-28 09:41:49 +01:00
Allan Jardine
1bb4fc6896 Dev fix: Typo from a67ff2f 2013-02-26 21:33:00 +00:00
Allan Jardine
a67ff2fadb Dev: Trivial tidy up of _fnConvertToWidth
- Just 43 bytes saved, but tidier code and smaller size...
2013-02-18 08:47:47 +00:00
Allan Jardine
7c53a1824c Dev: Tidying up scrollbar width calcuation function
- Using jQuery we can make the code a bit smaller. Not much, just a 97
  byte saving, but every little helps, as they say....
2013-02-18 08:42:32 +00:00
Allan Jardine
4c4bfb04b8 Dev: Remove trailing white space
- JSHint flagging warnings on trailing whitespace, so tidying up. Boring
  commit, but these things must be done!
2013-02-17 17:59:27 +00:00
Allan Jardine
6e012c8ee1 Dev fix: Thousands separator was incorrectly applied
- This was from my old work on experimenting with removing hugraian
  notation, it slipped through to be committed.
2013-02-16 11:33:50 +00:00
Allan Jardine
f3ce2e2d44 Fix 151: Column type was being offset when columns were not searchable 2013-02-16 11:27:41 +00:00
Allan Jardine
d5fb56ff37 Update: Update to jQuery 1.9.1 2013-02-16 11:26:54 +00:00
Allan Jardine
39ad1e7004 Dev: Small size reduction in SSP parameter build
- Saving of just 269 bytes in minified file, but non-the-less welcome
2013-02-10 12:18:00 +00:00
Allan Jardine
28c60e92a6 Dev fix: Undefined variable (JSHint) 2013-02-10 12:17:39 +00:00
Allan Jardine
2b6788011f New: ajax parameter to control all aspects of Ajax that DataTables uses
- DataTables 1.9 had 5 different parameters that controlled how Ajax
  data was obtained, which with its own naming properties, often mapping
  to the jQuery.ajax methods, or otherwise extending them. To hugely
  simply and extend the Ajax functionality DataTables has, these five
  parameters have now been deprecated and the funtionality provided by
  them merged into the new `ajax` parameter.

- Deprecated properties:
   - sAjaxSource
   - fnServerData
   - sAjaxDataProp
   - sServerMethod
   - fnServerParams

- Note that these parameters are still fully supported and can be used,
  but for new projects, `ajax` should be used as they will eventually be
  removed (likely DataTables v2 whenever that is, as they are too widely
  used to be removed in v1.x).

- Added additional / missing tests for the deprecated properties to
  ensure full backwards compatiblity

- The new `ajax` property is fully documented in the doc comments, but
  as a summary it can take three forms:
   - string - the url to get the data from (i.e. this is the new
     sAjaxSource)
   - object - maps directly to jQuery.ajax, allowing full control of the
     Ajax call (provides the abilities of fnServerParams, sServerMethod,
     sAjaxDataProp)
   - function - a function so you can get the data your own way
     (provides the abilities of fnServerData)

- Added unit tests for the new `ajax` property and doc comment examples
  updated to use this property exclusively.
2013-02-10 11:58:58 +00:00
Allan Jardine
fad7536608 Fix: $().andSelf() was deprecated in jQuery 1.8
- As of jQuery 1.8 `andSelf` was deprecated in favour of `andBack`.
  `andBack` was not available in jQuery <1.8, and I don't want to make
  1.8 a requirement yet, so a small workaround requiring two unbind
  calls is used to avoid calling `andSelf` or `andBack`.
2013-02-07 08:29:51 +00:00
Allan Jardine
da2a834177 Dev: Tidying up documentation comments for main DataTables file 2013-02-05 09:36:58 +00:00
Allan Jardine
d740f0484d Update - docs: Add examples for the xhr event and clarify when it fires
- `xhr` event fires before DataTables processes the returned data, so
  you can listen for `xhr` and use it to manipulate the returned data.
2013-02-05 09:31:48 +00:00
Allan Jardine
f35801b111 Fix: jQuery migrate warning on display length initial setting
- jQuery migrate gives a warning about the use of `attr` rather than
  `prop`. However, we should really just be using `val` here - much
  easier.

- Thread: 13931
2013-02-05 06:49:59 +00:00
Allan Jardine
8045c7471e Dev: Committing recent changes into built script 2013-02-04 19:57:59 +00:00
Allan Jardine
1b6ffeaf78 Updated: data and render can now have periods escaped from dotted
object notation.

- Previously if you had an object key that contained a period, it
  wouldn't work with `data` or `render` (or rather it would need a
  function call to do it manually), since a split was being done on the
  periods to reconstruct the Javascript object property chain. Now it is
  possible to escape a period, allowing it to be included in the
  property name read / set.

- Example:

$('#example').dataTable( {
	columns: [
		{ data: 'a' },
		{ data: 'b\\.c' }
	],
	data: [
		{ 'a': 1, 'b.c': 2 },
		{ 'a': 3, 'b.c': 4 },
		{ 'a': 5, 'b.c': 6 },
		{ 'a': 7, 'b.c': 8 }
	]
} );
2013-02-04 19:44:41 +00:00
Allan Jardine
b2de50229e New: data and render options for columns support function notation
- As part of completing the planning development for reading data, I've
  added support for calling functions from the string defined in `data`
  and `render` column options. So you can now do something like:
  `render: 'name()'` rather than needing to use an anon function and
  calling name() in that. This is useful for cases where you want to
  give DataTables an array of Javascript instances, rather than objects
  or arrays (see example below). It also fully supports the continuation
  of the dotted notation DataTables supports, so you could use
  `name().first` if `name()` returns an object. Again to make it easier
  than needed to define a function.

- Documentation for `data` and `render` updated to reflect this
  abilities

- Unit tests for this still to come

- There is one backwards incompatiblity that should be noted - although
  I think this is a real edge case and I just can't see it being an
  issue. If before, you had `data:null` without `render` or
  `defaultContent` specified, DataTables would have output an empty
  cell. Now it will output the original data source object. Can't see
  this being an issue since, why would you have a column empty cells? If
  this is an issue, then you simply need to add `defaultContent:''` now.

- Example use case, using Javascript instances:

$(document).ready(function() {
  var z = function (i) {
    this.a = function (set) {
      if ( set ) {
        return this;
      }
      return i+'-0';
    };
    this.b = function (set) {
      if ( set ) {
        return this;
      }
      return i+'-1';
    };
    this.c = function (set) {
      if ( set ) {
        return this;
      }
      return i+'-2';
    };
    this.d = function (set) {
      if ( set ) {
        return this;
      }
      return i+'-3';
    };
    this.e = function (set) {
      if ( set ) {
        return this;
      }
      return {
        q: i+'-4q',
        w: i+'-4w'
      };
    };
  };

  window.dataset = [
    new z(0),
    new z(1),
    new z(2),
    new z(3),
    new z(4),
    new z(5)
  ];

  $('#example').dataTable( {
    columns: [
      { data: null, /*render: 'a()'*/ },
      { data: 'b()' },
      { data: 'c' },
      { data: 'd()' },
      { data: 'e().q' }
    ],
    data: dataset
  } );
} );
2013-02-04 11:05:40 +00:00
Allan Jardine
b4aee323bd Fix #136 - Allow bDestroy / bRetrieve to have defaults set
- Typically I think setting bDestroy or bRetrieve as default true is a
  bad idea as it could lead to more processing of tables than is needed
  by mistake, but if set the defaults should be acted upon.

- These are slightly different to the other defaults since the settings
  object hasn't been expanded by the point they are checked, so need to
  manually check the values.
2013-02-02 12:09:15 +00:00
Allan Jardine
10a0d7bd04 Dev: Update comments for browser feature detection 2013-02-01 10:29:03 +00:00
Allan Jardine
415ce622c3 New: Scrolling support for rtl language layout
- When scrolling is enabled, the scrollbar can be placed on the right or
  the left of the scrolling container by the browser for rtl layout (of
  the current browsers, only Safari appears to place it on the right) -
  when placed on the left the padding adjustment that DataTables makes
  for the scrollbar area was added to the wrong side.

- To cope with this, the browser compat method (moved to the compat
  file) will check for the position of the scrollbar and set a flag so
  the scroll draw can adjust the position as needed.
2013-02-01 10:05:45 +00:00
Allan Jardine
177400121e Fix: Documentation typo or sWidth 2013-02-01 10:04:20 +00:00
Allan Jardine
0e8e0d6793 Update: Updating to jQuery 1.9 2013-02-01 10:02:57 +00:00
Allan Jardine
076744a84c Merge branch 'master' of github.com:DataTables/DataTables 2012-12-21 09:36:10 +00:00
DukeAstar
d9bb6b63cd Fix backward compatibility with mDataProp = null 2012-12-07 22:32:41 +01:00
Tiax
a528bbb6b6 Applying proper CSS classes for sorting to columns
As discussed on the forums here: http://datatables.net/forums/discussion/12736/setting-sortable-with-aocolumndefs-glitched
2012-11-23 10:49:26 +01:00
Allan Jardine
36fc3cc92e Update: If aLengthMenu is given, but iDisplayLength is not, DataTables used to default to using the built in iDisplayLength option. However, this lead to a bit of confusion as to why the first value from aLengthMenu was not used (issue #61 and numerous forum posts). This commit changes that behaviour - the first value from aLengthMenu is used, if iDisplayLength is not given as well. 2012-11-02 09:28:06 +00:00
Allan Jardine
823e64cccb Dev: A bit of love for hte type detection functions. Tidy them up and improve the comments. 2012-11-02 08:43:37 +00:00
Allan Jardine
33d3667bbe Update: Much smaller numeric type detection method, based on isNumeric in jQuery. Also a whole lot faster. 2012-11-02 08:33:07 +00:00
Allan Jardine
a073515b20 Update: fnUpdate is now inline with the changes to how data can be added to the table. Rather than taking a copy of the data source, it will simply assign the data given to the row (if it is given for the row) and apply it. Documentation comments update as well. 2012-11-01 21:56:02 +00:00
Allan Jardine
065c2cc66b Fix: Filtering wasn't correctly applying the type adjustments needed for the global filter. For example this meant that html was not stripped from 'html' type columns, resulting in filtering being done on html tags/attributes as well as the content. 2012-11-01 21:45:48 +00:00
Allan Jardine
b56f3619cb Dev: Remove padding on code when in the syntax highlighter 2012-11-01 21:45:26 +00:00
Allan Jardine
46d483d055 Tests: With the change for the state saving into localStorage we need to update the state destroy in the unit tests 2012-10-31 18:12:22 +00:00
Allan Jardine
94f06473c6 New: DataTables now uses HTML5 localStorage by default for state saving. This has a number of advantages over cookies, the first of which is that we are no longer limited to 4KiB in size. It also makes HTTP requests faster since they aren't included in the HTTP transport. Better yet, the removal of the cookie code reduces the DataTables minified size by 1.5K (1573 bytes). It must be noted that this does mean that IE6/7 don't, by default, work with state saving in DataTables. If support for those browsers is required, then fnStateSaveCallback and fnStateLoadCallback must be used by the developer to define their own state saving methods.
Removed: fnCookieCallback (cookieCallback) - This is now irrelevant since DataTables does not state save in cookies by default.

Removed: sCookiePrefix (cookiePrefix) - This is now irrelevant since DataTables does not state save in cookies by default.

Depreciated: iCookieDuration (cookieDuration) - Since DataTables does not use cookies for state saving by default the name of this parameter is now incorrect. The new parameter `stateDuration` should be used instead, although the old parameter is still supported. It will be removed in the next major version of DataTables.
2012-10-31 18:09:41 +00:00
Allan Jardine
c883cdac54 Dev: Fix issue with the moved oInit defaults copy - couldn't get a reference to an exisiting DataTable 2012-10-31 15:42:09 +00:00
Allan Jardine
0ff0858734 Dev: Fix logic check for passing data to the updated _fnCreateTr method 2012-10-31 15:39:10 +00:00
Allan Jardine
5209e2f058 Dev: Removed the _fnGatherData method, replacing it with _fnAddTr and slightly updated _fnAddData / _fnCreateTr. This means that the new API add add existing TR element if needed, but more importantly it reduces code duplication and makes the code size smaller (almost 1K - 967 bytes exactly, minified). Must confess I was really hoping it would be more, but every little helps... 2012-10-31 14:56:34 +00:00
Allan Jardine
3ac3cedf53 Fix: When sorting numerically, '-' and '' should be treated as -Infinity rather than as 0, since negative numbers could also be used int he column and this would split the numbers. 2012-10-30 21:05:15 +00:00
Allan Jardine
ec0556b4f6 Updated: Changing the formatting that DataTables uses for the version numbers to be compatible with semver (http://semver.org/). The impact is minimal (unless you are parsing the version for the final part in dev builds). The change is to use a dash ('-') at the end of the version string for a non-release build, rather than a dot. 2012-10-28 16:39:35 +00:00
Allan Jardine
eafd70f53a Dev fix: When updating the parameters for lack of hungraian notation, I renamed 'iDeferLoading' as 'deferLoading' which broke server-side processing... 2012-10-28 16:34:11 +00:00
Allan Jardine
8eb8c90627 Dev - Build latest changes 2012-10-26 08:04:14 +01:00
Allan Jardine
e89958cb45 Fix docs: Example for mRender has a syntax error 2012-10-26 08:02:59 +01:00
Allan Jardine
cab0c534f1 Fix - core: Stripe removal was broken - it was stripping the classes from only the first row rows, rather than all of them, which was wrong. This was unfortunatly introduced in 1.9.4 and there weren't any unit tests to catch it. There are now, and I've rewritten the code that wil remove existing stripe classes. Its now much smaller and should be a little faster. Now it only checks the first row to see if it has any exisiting stripe classes, which is good enough. The smallest this could could be would be a simple removeClass, but that may result in significant overhead which really isn't needed in cases where there are no exisiting stripe classes. 2012-10-19 15:31:35 +01:00
Allan Jardine
8e1068e603 Dev fix: Fix issue highlighted by JSHint - The DataTable object is addressed in the private methods so it needs to be defined before them, but the contracturo needs to come after the priavte methods! 2012-10-07 18:13:16 +01:00
Allan Jardine
0e3a60b52f Dev fix: Variable name oSettings was incorrect 2012-10-07 18:11:54 +01:00
Allan Jardine
f7dddabfa3 Fix: Trailing comma 2012-10-07 18:11:41 +01:00
Allan Jardine
de935de4c6 Merge branch 'master' of github.com:DataTables/DataTables 2012-10-07 18:08:56 +01:00
Allan Jardine
ab454c1c33 Fix: In _fnExtend there was a bug where a variable referenced a 'locally global' (for lack of a better term) variable rather than the in function variable that it should be have. Got away with this since _fnExtend is only used for one thing at the moment, but it was wrong. Now fixed.
Update - Performance / Memory: The functions that DataTables uses are not instance based, they are locally scoped, but they were included in the DataTable constructore, which meant that every time you create a new 'instance' of DataTables ($().dataTable()) it would create these functions in that scope again and again. That's completely pointless since we only need them once, so moving them outside the constructor helps both performance and memory (not huge, but very little helps!).
2012-10-07 18:02:38 +01:00
Tim Tucker
2b35b262cb Update media/src/api/api.static.js
Variable initialization was wrong in the prior pull (should have been iThat, not sThat)
2012-10-07 09:11:10 -03:00
Allan Jardine
f420f1462b Merge pull request #117 from timtucker/patch-29
Dev: Modify how DataTables builds the filtering regular expressions to simplify.
2012-10-07 04:31:06 -07:00
Allan Jardine
ec10497217 Dev: Update generated file from the marges made recently 2012-10-07 12:23:24 +01:00
Allan Jardine
7a388a0a76 Merge branch 'master' of github.com:DataTables/DataTables 2012-10-07 12:23:07 +01:00
Allan Jardine
09a9976907 Dev: Trivial code styling change 2012-10-07 12:22:18 +01:00
Allan Jardine
7bcd2955ff Merge pull request #116 from timtucker/patch-28
Dev: Remove unused variable in _fnDraw
2012-10-07 04:15:17 -07:00
Allan Jardine
76507795ed Merge pull request #109 from timtucker/patch-22
Update media/src/core/core.ajax.js
2012-10-07 04:14:12 -07:00
Allan Jardine
be6fc4185d Merge pull request #106 from timtucker/patch-19
Dev: Simplify language handling of start number for infinite scrolling
2012-10-07 04:12:23 -07:00
Allan Jardine
8cabf6f830 Merge pull request #107 from timtucker/patch-20
Dev: Different algorithm for fnVersionCheck
2012-10-07 04:10:43 -07:00
Allan Jardine
542066100a Merge pull request #115 from timtucker/patch-27
Update media/src/core/core.draw.js
2012-10-07 04:09:27 -07:00
Allan Jardine
8b6e3fe264 Merge pull request #108 from timtucker/patch-21
Fix: Update string sorting to correctly sort undefined values.
2012-10-07 04:08:40 -07:00
Allan Jardine
a0455fa858 New: The primary public interface for DataTables' initialisation options is now camel case parameters rather than the Hungarian notation that was used before. There are a number of reasons for doing this, the primary one being that the Hungarian notation used by DataTables is actively stopping people from using the library due to their aversion to using Hungarian notation. Without doubt the Hungarian notation used was a mistake (the reason it was used was that when DataTables was originally written, the company I worked for at the time required the use of Hungarian notation, and thus I was trained in it...).
Backwards compatibility issues: The main goal here (other than to use camel-case notation!) is to preserve backwards compatibility. Unfortunately this isn't 100% possible:
	- DataTable.defaults.columns has been renamed to be DataTable.defaults.column
		- Otherwise it conflicts with aoColumns in the defaults.

Without doubt this is going to be a long process - for example the unit tests and examples need to be completely updated for this change. The JSDoc comments have been updated, so the site should take care of itself for the most part, when released.

In terms of implementation, it is important to note that I have not broken backwards compatibility here - the way it is does is that the current defaults are retained, and a camel-case to Hungarian mapping is automatically generated and then applied to the objects given by the end user. This adds around 0.5K to the size of DataTables, but writing the mapping manually would require at least 3K, and changing DataTables wholesale to camel-case would utterly break backwards compatibility. This is the least 'evil' way to accomplish this. It is important to note that this is a step along the roadmap for DataTables - come v2 Hungarian notation will likely be dropped completely.

One important note to make about this mapping is that if you use camel-case DataTables will copy the value from the camel-case properties to their Hungarian counterparts, so you will end up with additional properties on your source object. As I say, this appears to be to be the least 'evil' option, although still not perfect itself. The challenges of working with legacy software and installs...!
2012-10-07 11:50:29 +01:00
Tim Tucker
223fed5e94 Update media/src/core/core.ajax.js
simplify conditions:
!A || (A && (B || C)
really is the same as:
!A || (true && (B || C))
which simplifies to:
!A || (B || C)
which simplifies to:
!A || B || C
2012-10-05 23:50:33 -03:00
Allan Jardine
60484bc93a Dev - Remove reporting code from the Ajax draw update - don't need it after the change for 36076fc5c8 2012-10-04 14:50:47 +01:00
Tim Tucker
15a3e7b97d Update media/src/core/core.filter.js
Reorder things a little to simplify
2012-10-02 09:18:45 -03:00
Tim Tucker
bd7d70c6b3 Update media/src/core/core.draw.js
Remove unused variable
2012-10-02 08:57:42 -03:00
Tim Tucker
fc445cd374 Update media/src/core/core.draw.js
Remove check for iOpenRows !== 0, since it isn't really needed.
(the contents of the loop just won't execute)
2012-10-02 08:55:18 -03:00
Tim Tucker
a3b5706105 Update media/src/core/core.ajax.js
Remove unnecessary else(s)
2012-09-30 20:11:36 -03:00
Tim Tucker
23fc3858d9 Update media/src/ext/ext.sorting.js
handle undefined values, skip toLowerCase call for empty strings
2012-09-30 20:05:09 -03:00
Tim Tucker
7f35d4fb4d Update media/src/api/api.static.js
Slightly shorter method for checking the version (stops as soon as it reaches a version part that has a difference)
2012-09-30 11:07:24 -03:00
Tim Tucker
473e9b0088 Update media/src/core/core.info.js
Only set iStart once and only call fnFormatNumber once on iStart.
2012-09-30 10:21:09 -03:00
Allan Jardine
c14b49fca3 Remove - asStripClasses backwards compatiblity. There was a typo for asStripeClasses back when it was first introduced, now here in 1.10 the patch that was used to allow both forms is removed. 2012-09-30 09:22:06 +01:00
Allan Jardine
6b605936f7 Update: Significant update to how sorting is applied internally in DataTables - there is no difference to how the sort is actually done, with the single exception that the -asc and -desc are not depricated in favour of the -pre method only.
- With the introduction of the -pre method in DataTables 1.9, the -asc and -desc sorting functions became more or less redundant since they are simple comparisons (all of the complexity is now in the -pre formatting function). As such the call to the -asc / -desc method is overhead that really isn't needed, and this commit introduces a sort function that doesn't call the -asc / -desc methods, instead just doing the comparison itself. In tests, this relatively simple change leads to a performance improvement of around 15% in all browsers (it also has the side benefit of less operations, so IE8- will be able to sort larger tables before flagging up a slow script warning).

- We can't just remove the sorting method which will call -asc / -desc though since not all sorting plug-ins will have a -pre method. Therefore, for backwards compatiblity the old sort function (albeit updated for the changed variables) is retained. The backwards compatibality code adds around 300 bytes to the library, but this is an unaccounced change, so backwards compatiblity must be retained.

- The old sort method will be removed in v1.11. The -asc and -desc methods are now fully depricated.

- Altered the sorting method to flatten the aaSorting array since the introduction of aDataSort in v1.9 required an extra loop in several locations. The functionality is very useful, but the extra loop can be a bit messy and slightly hit performance, so it is now flattened to be a single array (with object information so it makes sense, rather htan array indexes!).

- Altered the order of sorting when building _aSortData since it was looking up the same variable smultiple times which really wasn't needed.

This is part of a small incremental changes plan for DataTables! There are still a huge number of things to improve in this area, but this is a nice clean up and a nice 15% sorting performance improvement to get us started :-).
2012-09-29 21:25:41 +01:00
Allan Jardine
6900a59e74 Fix - docs: Need to escape the underscores for markup output when we now use. 2012-09-29 21:24:56 +01:00
Allan Jardine
36076fc5c8 Removed: sName reordering on return from the server when server-side processing. This was depricated in DataTables 1.9 and is now removed. This was an inefficient way to supply data to the DataTable in an array that was out of order and the client-side would reorder the arrays into what was needed. The way to do this now is to use mData and JSON objects rather than arrays, as it provides much greater flexibility without a performance hit on the client-side.
Note: _fnColumnOrdering is left in place at the moment, although it may be updated as work progresses on 1.10 with regard to the increased use of column names.
2012-09-23 18:49:11 +01:00
Allan Jardine
8d56d0204e Starting DataTables 1.10 development :-)
Removed: fnRender - fnRender was depricated in 1.9 and is now being completely removed here. Its always been a bit messy and is now superseded by mRender. The main reason for this is that DataTables use to take an independent copy of the input data source object / array. This is a performance hit and it means we can't do any binding to external objects (for example it makes Knockout integration almost impossible).
Removed: bUseRendered - with fnRender being removed, bUseRendered is irrelevent
Updated: With fnRender being removed we no longer need to take an independent copy of the data source object / array (since DataTables itself isn't ever going to write to it now - fnRender did and the copy was included so we didn't inadvertantly change a developers data source object without them knowing about it. This is no longer a problem, and in fact having it use the same data source object is extremely useful in many cases.
2012-09-23 18:38:25 +01:00
Allan Jardine
6c41618c71 Update: jQuery 1.8.2 2012-09-23 14:18:58 +01:00
Allan Jardine
822c62d05d DataTables 1.9.4 2012-09-23 14:16:14 +01:00
Allan Jardine
26d2926390 Fix: Ie9 throws an error when document.activeElement is used inside a frame or iframe... So need to wrap the test up in a try/catch. Nasty. 2012-09-23 13:12:39 +01:00
Allan Jardine
bd6bb74967 Fix: Header TD elements need an outline of none to stop of focus flicker (matching TH elements which already have this) 2012-09-19 07:27:52 +01:00
Allan Jardine
b4cd9f11c6 Fix: A header made of only TD elements wasn't being correctly detected - 11705 2012-09-19 07:27:11 +01:00
Allan Jardine
77a8cb5946 Update: jQuery to 1.8.1 2012-09-19 07:26:21 +01:00
Allan Jardine
d1142e1450 Fix: If the user is currently focused on the filtering input element, don't overwrite the value that is already shown as this will effect the cursor position. 2012-09-16 12:00:36 +01:00
Allan Jardine
a19e1dee12 Dev: Use className for the newly created TR - slightly faster than addClass which isn't needed here 2012-09-16 11:19:53 +01:00
Allan Jardine
e25b377ee8 Fix: State saving deletion of cookies was somewhat broken. It would delete cookies out of order, which is not what we want. Rewrite how the 'overage' of cookies (4K limit) is handled 2012-09-13 18:13:32 +01:00
Allan Jardine
a43714bfba Fix - docs: sNext and sPrevious referened to full_numbers pagination type, but they can be used for any pagination control: 9192 2012-09-12 07:47:29 +01:00
Allan Jardine
66e92ab655 Fix - docs: Documentation error for fnGetPosition - missing one of the return indexes - 11708 2012-09-11 10:09:03 +01:00
Allan Jardine
ca96ed55d5 Fix: Remove irrelevent and broken bSortable check for the column options - fix issue #101 2012-09-11 07:04:41 +01:00
Allan Jardine
0a3793b4bb Dev: Tidy up the way that the header and footer elements are 'got'. Based on pull request #92. 2012-09-09 18:43:57 +01:00
Allan Jardine
df614240cf Update: Fully deprecate fnRender - it will be removed from the next major version of DataTables and it is strongly adviced that you do not use it! 2012-09-09 12:26:57 +01:00
Allan Jardine
880de42c6e Dev: Remove debug from last commit... 2012-09-09 12:05:20 +01:00
Allan Jardine
555aacfc6d Fix: mRender and mData now work in the same way for DOM sourced tables as they do for JS sourced table data. Generally we wouldn't really expect them to be used as much for DOM sourced tables (if you want your table formatted differently, you'd just create the HTML differently!), but it can sometimes be useful to use these options. This also brings mRender to full 'pace' ready to be used in complete preference to fnRender (alongside the other methods for cell rendeirng such an fnCellCreated etc). 2012-09-09 11:57:02 +01:00
Allan Jardine
898357fc84 Merge pull request #98 from timtucker/patch-14
Update media/src/core/core.sort.js
2012-09-04 09:38:03 -07:00
Allan Jardine
30f936d8ff Merge pull request #97 from timtucker/patch-13
Update media/src/core/core.info.js
2012-09-04 09:30:58 -07:00
Allan Jardine
6d11218a7f Merge pull request #96 from timtucker/patch-12
Update media/src/core/core.info.js
2012-09-04 09:30:06 -07:00
Allan Jardine
bb08308dfe Merge pull request #95 from timtucker/patch-11
Update media/src/core/core.sizing.js
2012-09-04 09:29:15 -07:00
Allan Jardine
3ffa14ea8a Merge pull request #94 from timtucker/patch-10
Update media/src/core/core.sizing.js
2012-09-04 09:28:07 -07:00
Allan Jardine
4603ad13d4 Merge pull request #93 from timtucker/patch-9
Update media/src/core/core.scrolling.js
2012-09-04 09:27:25 -07:00
Allan Jardine
95381359ed Merge pull request #91 from timtucker/patch-7
Update media/src/core/core.scrolling.js
2012-09-04 09:24:50 -07:00
Tim Tucker
a66bec8368 Update media/src/DataTables.js
Simplify by not passing in undefined to the outer closure
2012-09-04 13:03:20 -03:00
Tim Tucker
89be8f4083 Update media/src/core/core.sort.js
Speed things up by applying classes only when needed
2012-09-04 11:05:53 -03:00
Tim Tucker
cb2495b440 Update media/src/core/core.sort.js
Use var to keep track of # of classes found (length on sparse array doesn't work properly)
2012-09-03 19:36:18 -03:00
Tim Tucker
6bce847a3b Update media/src/core/core.sort.js
Further refinement - stop once all sorting classes have been seen
2012-09-03 19:12:03 -03:00
Tim Tucker
2afa5e4360 Update media/src/core/core.sort.js
Combined method for removing classes
2012-09-03 18:21:01 -03:00
Tim Tucker
e6e4205b02 Update media/src/core/core.sort.js
Forgot parameter to lastIndexOf
2012-09-03 16:54:30 -03:00
Tim Tucker
6a5c4cf261 Update media/src/core/core.sort.js
Use simpler dom-based method for deferred render
2012-09-03 16:53:00 -03:00
Tim Tucker
24fc23f63d Update media/src/core/core.sort.js
Simplify and improve performance
- Only check once for the presence of any sorting class instead of checking for the 3 individual classes
- Use lastIndexOf(str, 0) instead of indexOf

http://jsperf.com/rep-reg-string/4
2012-09-03 16:29:28 -03:00
Tim Tucker
af5c3d8178 Update media/src/core/core.info.js
Simplify check for filtering / empty record set
2012-09-03 14:02:38 -03:00
Tim Tucker
3485f6530a Update media/src/core/core.info.js
Use greedy match regex for replacements

Otherwise, you could have:
"_START_ of _TOTAL_, showing _START_ to _END_"
replaced as:
"1 of 5, showing _START_ to 3"
2012-09-03 13:52:30 -03:00
Tim Tucker
ef1c0890df Update media/src/core/core.sizing.js
Use document.body rather than document.getElementsByTagName
(Makes things consistent with the rest of the codebase and should be faster)

http://jsperf.com/document-body-vs-document-getelementsbytagname-body-0
2012-09-03 13:34:10 -03:00
Tim Tucker
4cbb9f3196 Update media/src/core/core.sizing.js
Define nWrapper earlier to avoid calling dom to get the parentNode multiple times in the initial loop
2012-09-03 13:11:11 -03:00
Tim Tucker
f5a772c594 Update media/src/core/core.scrolling.js
Use o.nScrollHead / o.nScrollFoot rather than traversing through the dom again to get the parentNodes for nScrollHeadInner / nScroolFootInner
2012-09-03 13:02:05 -03:00
Tim Tucker
70cea14422 Update media/src/core/core.scrolling.js
Only pass in what's needed to _fnApplyToChildren (don't need to be passing in both the sizer and node to size in most cases).
2012-09-03 12:38:09 -03:00
Allan Jardine
59dc2aed9c Dev: Fix a couple of issues that were introduced in pull request #85 - 1. Mix of spaces and tabs :-). 2. documentation generation was broken due to the use of another closure, 3. minification was broken as window, document, undefined were been aliased and 4. jshint was throwing errors. This addresses those issues, primarily by shifting the closures around. 2012-09-02 10:33:49 +01:00
Allan Jardine
e69e3c6c1c Dev update: Commit built changes from Tim Tucker from last few merges 2012-09-02 09:49:17 +01:00
Allan Jardine
9c82abe79d Merge pull request #89 from timtucker/patch-6
Use hasChildNodes() rather than childNodes.length
2012-09-02 01:40:10 -07:00
Allan Jardine
a950fb0642 Merge pull request #88 from timtucker/patch-5
Update media/src/core/core.data.js
2012-09-02 01:38:58 -07:00
Allan Jardine
1fdfb65457 Merge pull request #87 from timtucker/patch-4
Allow adding / removing an arbitrary number of stripes
2012-09-02 01:37:58 -07:00
Tim Tucker
30eb6f0426 Update media/src/ext/ext.paging.js
Cache node
2012-08-31 18:48:15 -03:00
Tim Tucker
55b8e6fd04 Update media/src/ext/ext.paging.js
Use a different approach that caches nodes
(may actually minify better as well)
2012-08-31 18:43:38 -03:00
Tim Tucker
0c0fef65c1 Update media/src/ext/ext.paging.js
Replace childNodes.length check with hasChildNodes() in one more place
2012-08-31 18:35:00 -03:00
Tim Tucker
d8d7759613 Update media/src/ext/ext.paging.js
Use hasChildNodes() rather than childNodes.length

See the following jsperf test for the difference in performance:
http://jsperf.com/haschildnodes-vs-childnodes-length
2012-08-31 18:32:01 -03:00
Tim Tucker
dd616424b9 Update media/src/core/core.support.js
Use firstChild / nextSibling rather than childNodes
2012-08-31 18:25:23 -03:00
Tim Tucker
1001a332fb Update media/src/core/core.data.js
_fnGatherData: Use firstChild / nextSibling to iterate rather than childNodes
2012-08-31 18:12:39 -03:00
Tim Tucker
845eaaab67 Update media/src/api/api.methods.js
Properly select every nth row for adding classes
2012-08-31 17:45:15 -03:00
Tim Tucker
82fad5ca50 Update media/src/api/api.methods.js
Allow for adding / removing an arbitrary number of stripe rows
2012-08-31 17:37:11 -03:00
Tim Tucker
75ce320838 Update media/src/core/core.constructor.js
Allow for adding / removing an arbitrary number of stripe rows
2012-08-31 17:31:00 -03:00
Tim Tucker
ce59c7403f Update media/src/core/core.scrolling.js
Tweaks to improve performance
Cache nodes
Restructure to use nextSibling rather than childNodes
(small increase in file size, but may be a slight decrease in minified size)
2012-08-31 16:25:35 -03:00
Allan Jardine
0d47107906 Merge pull request #84 from timtucker/master
Update to docs
2012-08-31 09:46:34 -07:00
Tim Tucker
3cc96cf58f Update media/src/core/core.draw.js
Cache row
Avoid array access to childNodes
Move unique calculation outside of loop
Declare all vars at head of function
Cache a[i] in fnShiftCol
2012-08-31 13:38:51 -03:00
Tim Tucker
37485da480 Update media/src/DataTables.js
Combine closures
2012-08-31 13:08:09 -03:00
Tim Tucker
66de941632 Update media/src/DataTables.js
Wrap with globals to ease minification
Fix check for preventing multiple instantiation
Change formatting
2012-08-31 12:39:28 -03:00
Tim Tucker
87b4055b7a Update media/src/DataTables.js
Add support for AMD-based module loaders (such as requirejs).
Should have no effect when loading normally.
2012-08-31 11:15:19 -03:00
Tim Tucker
6fa5559dc3 Update media/src/core/core.sizing.js
Doc update -- getWidestNode returns node, not string
2012-08-31 11:00:48 -03:00
Tim Tucker
08619a3a21 Update media/js/jquery.dataTables.js
Update doc to reflect that _fnGetWidestNode returns a node, not a string.
2012-08-31 10:48:55 -03:00
Allan Jardine
6855be79f5 Examples: Add <code> CSS markup for examples. 2012-08-30 19:32:31 +01:00
Allan Jardine
c2af41140b Performance: Large improvement in scrolling performance due to rearranging the way that column widths are read and applied to the target table. Rather than merging reading and writing together, we now seperate the reading and writing phases, allowing the browser's rendering engine to optimise the reflow. Props to jlabanca for this modification - 11541 2012-08-30 07:29:50 +01:00
Allan Jardine
9f8d2a632b Moving on to 1.9.4 development 2012-08-22 16:41:52 +01:00
Allan Jardine
34096537c2 Fix: Firefox Windows (not Mac) had an error when calculating if scrolling oversizing was needed or not (_fnBrowserDetect). The result was that the table did not fill the space when y-scrolling was enabled and Firefox Windows was used. Fix is to remove the height on the DT_BrowserTest parent as suggested by randomuser - 11406 2012-08-22 16:39:36 +01:00
Allan Jardine
93774f4d7d Merge branch 'master' of github.com:DataTables/DataTables 2012-08-22 16:39:25 +01:00
Allan Jardine
3c358417e0 Update: Updating to jQuery 1.8.0 2012-08-22 16:38:36 +01:00
Patrick Cook
05201c21c4 Modified destroy method to only restore hidden columns if the table is not
being removed from DOM
2012-08-21 12:43:13 -07:00
Patrick Cook
854612a399 Added fix for memory leak because of potential circular reference 2012-08-15 23:31:14 -07:00
Patrick Cook
f6ffbc7e28 Memory clean up of _that variable 2012-08-15 07:08:48 -07:00
iBiryukov
e15342225c Small Typo Fix 2012-08-10 19:46:06 +02:00
Nguyen Nguyen
5ac94e2512 Move to the right place (src, not the generated file) 2012-08-10 01:36:55 -05:00
Nguyen Nguyen
f29bd9ffbf Update to use false value in bRemove arg in fnDestroy 2012-08-09 18:10:07 -05:00
Allan Jardine
b16efbc62a DataTables 1.9.3 :-) 2012-08-08 22:39:39 +01:00
Allan Jardine
725c1b68ba Fix: Typos in documentation comments and source comments - 11083 2012-08-08 22:22:45 +01:00
Allan Jardine
1f0b162760 Dev fix: In the update to the search array building methods I neglegted to strip \n\r from all rows (only HMTL rows were being stripped) - this is required for searching to work as expected. Picked up by the unit tests. 2012-08-08 22:05:14 +01:00
Allan Jardine
fd0e0a42e4 Fix #39 - null values should also be considered like undefined values when working with nested data and have properties created as needed. 2012-08-08 20:16:40 +01:00
Allan Jardine
0804c50d72 Dev: Unit tests for set functions 2012-08-08 20:02:59 +01:00
Allan Jardine
9a7613362f New: xhr event now has the json returned from the server as the third parameter. 2012-08-08 16:29:27 +01:00
Allan Jardine
9c51aa0ad7 New: xhr event 2012-08-08 16:27:42 +01:00
Allan Jardine
320f53e217 New: When making an Ajax call for data (fnServerData) and the server responds with the JSON parameter "sError" set, Data
Tables will alert this out. Typically end users should never see this - it is useful for error reporting from the server
 though.
2012-08-06 20:41:49 +01:00
Allan Jardine
ed935f3fb8 New: When making an Ajax call for data (fnServerData) and the server responds with the JSON parameter "sError" set, DataTables will alert this out. Typically end users should never see this - it is useful for error reporting from the server though. 2012-08-06 20:39:57 +01:00
Allan Jardine
45a6d2b505 Fix: null values that were applied to extended object properties were not being correctly applied since typeof null === 'object' - 11180 2012-08-04 09:34:26 +01:00
Allan Jardine
5311067cd2 Dev: Tidy up _fnColumnIndexToVisible and _fnVisibleToColumnIndex to use the new _fnGetColumns method. 2012-07-31 09:39:51 +01:00
Allan Jardine
d034d187bd Performance: Alter how _fnBuildSearchRow works to be much faster. For this a new method call _fnGetColumns is introduced which will pluck the column indexes that we want into an array that can then be iterated over (rather than spinning over the full aoColumns array twice, we now do it only the once for columns which are actually marked as searchable). Also use array join rather than string concatination to keep the number of operations down as much as possible. The callers of _fnBuildSearchRow must now pass in the data to be searched, limited by the searchable flag (i.e. call _fnGetRowData with the column indexes from _fnGetColumns).
Fix: Use jQuery html() and text() for HTML data to search method. Much tidier and copes with strict XHTML - downside is that it is a little slower if & is in a data string.
2012-07-31 09:25:35 +01:00
Allan Jardine
a3a4619f12 Fix - documentation: Two syntax errors in the examples, one for fnStateSaveParams and the other mDataProp - 11083 2012-07-30 10:04:42 +01:00
Allan Jardine
a79e5127f5 Fix: Remove dud CSS from themeroller file - 10794 2012-07-10 08:11:23 +01:00
Allan Jardine
1186901c95 Fix: Remove duplicate CSS lines - 10663 2012-06-30 07:07:52 +01:00
Allan Jardine
f03c670cf9 Update: Unit test updated for the mData name change from mDataProp. Note that a number of tests to test the backwards compability of mDataProp! 2012-06-29 20:10:15 +01:00
Allan Jardine
d155f7a7e7 Updated: Renaming mDataProp to mData for naming consistency and to show its flexibility. Please note that this is a backwards compatible change! DataTables will automatically check for mDataProp on a column and use that if required (if both mData and mDataProp are given then the new mData is used in preference). 2012-06-29 20:08:52 +01:00
Allan Jardine
4886322183 New: mRender option for columns - this is effectively a simpiler version of mDataProp for reading data only (while mDataProp also sets data), and much more comprhensive than fnRender (as such fnRender is now offically deprecated). See the documentation comments in model.defaults.columns.js for further information on how to use mRender. 2012-06-29 19:37:22 +01:00
Allan Jardine
0ed6ceda95 Updated: mDataProp syntax now has the ability to accept array syntax (for example "access[].name" would get an array of the 'name' properties from the access property of the data source). This is exceptionally useful for manipulating arrays - however, you are very _strongly_ advised not to use in in mDataProp itself, since when setting arrays, you will overwrite the old array (thus destroying any other properties that it already has!). Instead, see the new mRender property if you want to make use of this syntax for drawing the table. 2012-06-29 17:47:00 +01:00
Allan Jardine
56b0d11c96 Fix: When fnUpdate is called with a column index given, assume that the update is for an individual cell (which the API call has specified, so this is the correct thing to do). This also lets us tidy up some of the code in fnUpate, partiuclarly when regarding deeply nested options. 2012-06-26 17:09:03 +01:00
Allan Jardine
a022e2f736 Dev - remove debug 2012-06-25 20:06:19 +01:00
Allan Jardine
40a236a7cc Update: Remove use of $.browser since this is depricated in jQuery 1.8 and will be completely removed in jQuery 1.9. Instead we now use feature detection to determine if there is a browser bug with the width calculation of scrolling elements that needs to be worked around. This does unfortunatly increase the code size a bit - it is either this or using user agent string detection (which is exactly what is being removed from jQuery).
Starting 1.9.3 development
2012-06-25 11:19:56 +01:00
Allan Jardine
1bd6b29fe4 DataTables 1.9.2 :-) 2012-06-22 08:19:26 +01:00
Allan Jardine
1055d27887 Fix: Regex filter escaping wasn't escaping the dash ('-') character believe it or not. That's been there since very early DataTables! 2012-06-13 18:27:04 +01:00
Allan Jardine
284658e3c9 Fix: When setting deeply nested object properties, where the parent object doesn't yet exist, don't just silently fail. Since we are setting a value, we are at liberty to create the parent object and then set the value - this now does so. 2012-06-07 09:43:47 +01:00
Allan Jardine
29e0d112cb Fix - docs: Add jqXHR saving to fnServerData example 2012-06-01 07:42:01 +01:00
Allan Jardine
3d802a685b Fix - docs: JSDoc syntax errors which were picked up by JSDoc Toolkit 2012-05-20 10:55:23 +01:00
Allan Jardine
391cd6a7a6 Fix - API: $ method, when used with defered rendering, when all rows have not been rendered, results in jQUery trying to perform a selector on 'null' which throws an error. Now check for the tr having being created before adding it to the array to pass to jQuery - 8862 2012-05-20 10:33:35 +01:00
Allan Jardine
b64dda47c3 Fix: fnDeleteRow could cause the page to drop back by one - 9505 2012-05-02 07:05:00 +01:00
Allan Jardine
49fe9f2e0e Fix: Calling fnClose in fnPreDrawCallback would result in an error - 9702 2012-04-29 18:57:37 +01:00
Allan Jardine
d512e8cce7 Dev - build the last change (fee3ba7) 2012-04-29 10:15:51 +01:00
Allan Jardine
fee3ba754f Merge pull request #46 from Petah/master
Allow custom JUI header and footer classes
2012-04-29 02:13:33 -07:00
Allan Jardine
c2a2b4f531 Fix - docs: fnStateLoad example has a spare parameter (although not in the parameters list). Removed 2012-04-29 08:23:17 +01:00
Allan Jardine
2884ee23d2 Start 1.9.2 development
Fix - docs: sDom default had an error in it for the closing bracket
2012-04-27 16:17:22 +01:00
Allan Jardine
f6372323e3 Update: -webkit0overflow-scrolling:touch on all dataTables_scrollBody CSS files 2012-04-15 19:21:52 +01:00
Allan Jardine
ba85dc22d6 DataTables - 1.9.1 release :-) 2012-04-15 19:16:24 +01:00
Allan Jardine
827d4c1ae4 Fix unit tests: Witht he change to allow info macros in any of the strings the unit tests need updating to reflect this 2012-04-13 18:23:43 +01:00
Allan Jardine
aef0be6a1d Fix unit test: Number of errors in this test 2012-04-13 18:23:19 +01:00
Allan Jardine
e290b2cd7a Fix - unit test: Async behaviour could cause test to fail since the init might not have been complete (amazing that it was passing all this time - faster computers and faster JS engines now causing it to fail!) 2012-04-13 18:22:18 +01:00
Allan Jardine
9ec52faec5 Dev fix: The change to set all Ajax properties has a knock on effect on setting deep objects that don't exist, since that is now attempted. Picked up by unit test. 2012-04-13 17:56:46 +01:00
Allan Jardine
814ce1f7d5 Update: Bring the mDataProp as a function functionality to parity for Ajax / JS sourced data and DOM sourced data. Previously DOM sourced data would call the 'set' option for the mDataProp function but Ajax/JS sourced data would not, resulting in the set option never being called for those table types, which is a total bummer when you want to do some formatting in the set option. So now it is called. I was slightly conerned about the performance hit since this means a couple of extra function calls for each cell, but its all in JS, no DOM and I can see virtally no difference with about 50'000 rows and 5 columns of data, so acceptable for the benefits. 2012-04-13 17:25:25 +01:00
Allan Jardine
513d6d5440 New: "destroy" event - when the table is destroyed the destroy event is now triggered. This is very similar to how aoDestroyCallback worked before, but this brings the implementation into line with the newer callback/events mechanisim used in DataTable 2012-04-13 15:26:30 +01:00
Allan Jardine
ac9e454e11 New: Column option "sCellType" - allows you to create TD (default) or TH cells for a column. Useful for creating row headings in the TBODY. 2012-04-13 13:31:02 +01:00
Allan Jardine
732d25b229 Fix: IE8 bug where an empty string read from a DOM input element is JSON encoded as '"null"' - absolutely mental! See this blog post for more information http://blogs.msdn.com/b/jscript/archive/2009/06/23/serializing-the-value-of-empty-dom-elements-using-native-json-in-ie8.aspx . 2012-04-13 11:56:01 +01:00
Allan Jardine
773c88b9f6 Fix: When mDataProp is given as a function, an error in getting the data would be rather ugly - 8400 2012-04-13 11:40:45 +01:00
Allan Jardine
8a66adc2d4 New: The _START_, _END_, _MAX_ and _TOTAL_ macros for the information language strings can now be used in any info string, rather than being limited to just the ones noted in the documentation - a new internal function called _fnInfoMacros is introduced to allow this to work - 9211 2012-04-13 11:29:56 +01:00
Allan Jardine
2a60a96177 New: Static API method - fnVersionCheck same as the version check that is already available as an instance method, but here available as a static API method attached to $.fn.dataTable
New: Static API method - fnIsDataTable - check if a TABLE node is a DataTable or not
New: Static API method - fnTables - get the DataTables that are initialised on the table (optionally limit to just the visible tables)
Examples update - Tabs and scrolling updated to use the new static fnTables method
Fix: Settings object model was missing the nScrollHead and nScrollFoot properties from the documentation
2012-04-13 10:44:25 +01:00
Allan Jardine
0518525f59 Fix: Captions which were positioned using caption-side:bottom (CSS) would be positioned incorrectly if using a scrolling table. Need to work around webkit bug 83867 to address this and add an empty tfoot element if one is not given - 2022 2012-04-13 09:25:47 +01:00
Allan Jardine
4be9b362c8 Fix: When scrolling and row height collapse was enabled, it was possible that the table column width applied would be too small due to the fact that a scrollbar would be shown for a fraction of a second, due to the height of the scroll body container enforced by the scroll collapse. Fix is to take into account the header height before the width calculation is done 2012-04-12 17:27:05 +01:00
Allan Jardine
3a27a605b9 Fix: Scrollbody height in IE7- - use offsetHeight consistently - 9424 2012-04-12 09:25:35 +01:00
Allan Jardine
5114e98a93 API - fix: The parameter for fnDraw was inverted by mistake in the 1.9.0 release - 7825 2012-04-04 08:28:35 +01:00
Allan Jardine
35a23adb75 Dev fix: Missed a variable def in the recent _fnLanguageCompat change 2012-04-02 11:53:13 +01:00
Allan Jardine
cd0babca54 Fix: IE6/7 return an empty string for getAttribute('id') when there is no ID attribute, rather than null. As such tables were not automatically being given an ID when they didn't have one, which created a situation where the settings object for a table could be 'lost' in IE6/7. Now check for empty string when checking the table ID. 2012-04-02 10:25:52 +01:00
Allan Jardine
04d4786455 Fix: IE6/7 when scrolling is enabled could loose the sorting event due to the way cloned nodes work in those browsers. Note that this was introduced after 1.9.0. Related - jQuery bug 10437 - http://bugs.jquery.com/ticket/10437 2012-04-02 10:03:47 +01:00
Allan Jardine
c1e40a8596 Fix: Language backwards compatibility could override developer defined defaults - 9267 2012-03-30 15:30:19 +01:00
Allan Jardine
e815062197 Fix: When -1 is selected for the display length (show all) the full numbers paging control didn't show page '1' - 9170 2012-03-30 07:48:33 +01:00
Allan Jardine
dec097ef50 Docs - fix: Show oSettings parameter in fnDrawCallback example - 9067 2012-03-26 07:50:38 +01:00
Allan Jardine
1d62b40f66 Docs - fix: Typos 2012-03-21 08:53:21 +00:00
Allan Jardine
f883df1afd Docs - fix: fnSort documentation updated to indicate column sorting - 9094 2012-03-21 06:49:24 +00:00
Allan Jardine
2096244c60 Fix: afnSortData functions were not being executed with the DataTables instance's scope 2012-03-19 12:09:49 +00:00
Allan Jardine
b5f4938d7d Fix: If sType for a column is html and the data is null, then _fnDataToSearch could throw an error - 8987 2012-03-14 07:51:07 +00:00
Allan Jardine
c22dfe00d3 Strip HTML from the aria-label tag for the sorting headers 2012-03-14 07:04:33 +00:00
Allan Jardine
74f970e1a7 Fix: Use border collapse in JUI stylesheet - 8931 2012-03-12 08:06:24 +00:00
Allan Jardine
918a065f21 Add documentation note on the fact that mDataProp as a function can get a 'type' of undefined when raw data is expected to be returned 2012-03-10 11:34:38 +00:00
Sahab Yazdani
1ef5243cab Remove unused variables from fnUpdate 2012-03-06 12:51:56 -05:00
Sahab Yazdani
f5ff5884bc Remove unused variables from fnSetColumnVis 2012-03-06 12:51:26 -05:00
Allan Jardine
f0c91b7a9c Update: Add -webkit-overflow-scrolling: touch; to the scrolling container to provide much improved scrolling interaction in browsers that support that (iOS5, and possibly new Andriod?) 2012-03-04 13:54:58 +00:00
Allan Jardine
cc42c49ec3 New - initisalisation: iDeferLoading can now also be an array allowing the developer to specify the number of records before and after filtering for the information display - 7936 2012-03-03 07:34:11 +00:00
Allan Jardine
fc730e17f3 Fix: The fnServerData error function can use the internal logging function now adays - make it do so - 8763 2012-02-29 10:33:03 +00:00
Allan Jardine
3a40c3a440 Fix: The sStripeOdd / sStripeEven options for the class objects were not being applied to the table. The fix is to set the default for asStripeClasses to be null, and then if null is found there, then the user hasn't applied a default, nor have they overridden the default, therefore we can use the classes from the class objects - 8770. 2012-02-29 09:09:16 +00:00
Allan Jardine
e40d1edebc Fix - docs: Link to sDom from bFilter was incorrect 2012-02-28 10:35:46 +00:00
Allan Jardine
5479600611 Fix - performance: Don't extend the passed in data a second time - its a waste of time 2012-02-26 19:12:11 +00:00
Allan Jardine
126a4fe44e Fix: When scrolling is enabled the initial width of the header was being set to 150% which was a bit random and could result in the header flashing its display in the wrong place when loading. The fix is to use 100% unless x-scrolling is being forced, at which point it needs to match the inner table - 8332 2012-02-25 07:56:27 +00:00
Allan Jardine
872dc0db3e Fix: Feature match the server-side sorting to the client-side sorting for what information is sent to the server for sorting. Previously aDataSort was no honored - https://twitter.com/#!/naomiaro/status/172397914239414272 2012-02-22 19:47:09 +00:00
Allan Jardine
bc756f3a69 Docs fix: fnStateLoad documention refered to fnStateSave instead of itself 2012-02-21 14:14:13 +00:00
Allan Jardine
793020a8d4 Updated: When throwing an error, throw a "new Error()" so we can get a bit more information about the error
Updated: When using custom sort data types, if the returned array is not of the required length (aoData.length), then an error is thrown
2012-02-20 08:15:28 +00:00
Allan Jardine
409edd791b Fix: When sorting non-string data as a string (type to type detection) then DataTables 1.9 would automatically convert the non-string data to an empty string so it can be sorted. This can result in unexpected ordering in the table. The fix is to check for a toString() function that is available for the data and if it is there, then use it (great for numeric data, dates etc), otherwise the empty string is used (null, methods without toString). This brings 1.9 back into line with how 1.8 behaved - 8549 2012-02-17 09:29:41 +00:00
Allan Jardine
af2e153bc3 Fix: When updating the filtering input control, we would just match on INPUT elements, so if the developer had appended an input button to the filter wrapper, that value would also be changed - 8537. Now a reference to the input element is stored and used to update the input value (this method means we don't need to add another class option, and developers can change to 'type=search' if they wish). 2012-02-15 09:36:51 +00:00
Allan Jardine
431b5e8a55 Fix: IE8 doesn't like the console check in logging - make it object based on window - 8517 2012-02-14 08:44:34 +00:00
Allan Jardine
ca009fdf88 Fix: When scrolling the column matching would remove any nested THEAD and TFOOT elements in the table - 8423 2012-02-08 08:34:39 +00:00
Allan Jardine
6021360da1 Docs: Fix - Parameter for filtering options in state saving examples should be oSearch, not oFilter - 8408 2012-02-07 14:28:46 +00:00
Allan Jardine
68975aff10 Docs: Fix - fnStateSaveParams refered to fnStateLoadParams in the example code - 8408 2012-02-07 14:23:46 +00:00
Allan Jardine
5907eb4639 Docs: Fix - 8400 - mDataProp when null incorrectly suggested that sDefaultContent was an empty string. It is infact null. Also typo fixes. 2012-02-06 18:26:13 +00:00
Allan Jardine
ab9dfd5052 Fix: x-scrolling to the end of a table would cause the header and the columns to go out of alignment due to the header not being able to scroll as far as was needed (this was caused by the changes in 876a75f) - 8332.
Fix: Table could conitnually expand when x-scrolling was enabled. This was partly addressed in 6776, but the fix was incomplete as it would still occur on Safari Mac (possibly other browsers as well). This fix is very closely related to 8332 (hence commiting together as they are interdependent). Now use padding right on the header/footer wrapper to provide the overflow scroll ability, but only add it when a scrollbar is present - otherwise the width gets added on and we get the forever expanding table.
Dev: Unit tests - New tests for scrolling to ensure 6776 and 8332 don't occur again
2012-02-06 18:09:16 +00:00
Allan Jardine
0151d43c25 Fix: When fnPreDrawCallback is used to cancel a draw the processing display would remain active - this should not be the case as DataTables is now finished with its processing - 8371 2012-02-03 17:46:05 +00:00
Allan Jardine
de6482a15e Fix: asStripClasses if given was being overruled by the default given for asStripeClasses - 8332
Fix: The extend function was only extending properties that existed on the original source object, not properties that only existed on the extender
2012-02-02 10:04:51 +00:00
Allan Jardine
92ce6487f2 DataTables 1.9.1 development begins
Fix: When using full numbers pagination in IE and clicking upon one of the numbers in the paging control, a Javascript error would occur due to trying to blur an element that was no longer in the DOM
2012-02-02 07:06:33 +00:00
Allan Jardine
2b126277fc DataTables 1.9.0! :-) 2012-02-01 14:03:06 +00:00
Allan Jardine
1af3ebaf48 Fix: Docs: oSearch should be a namespace 2012-02-01 10:25:26 +00:00
Allan Jardine
7e18f3b484 Fix: Docs: fnVersion check should be marked with @type function 2012-02-01 09:53:39 +00:00
Allan Jardine
a3398d9b00 Docs: The options (properties) for the DataTables initialisation object that have a default function need an @member tag otherwise they are documented as methods, which they are not. 2012-02-01 09:07:52 +00:00
Allan Jardine
62e5221184 Fix: Docs: Typo 2012-02-01 08:24:55 +00:00
Allan Jardine
468390c337 Fix: When mDataProp was used to get a nested object, but a parent object didn't exist it would throw an unrecoverable error. With this change the behaviour matches that of single level data whereby if data cannot be found, at any level, then undefined is returned from the data get object. This means that if sDefaultContent is defined then that will be used instead, and if not defined an error will still be given (although this one under DataTables' control).
Dev: Removed the "fast lookup" function for data get and set as they weren't really that useful in terms of speed and would require more code to be added to copy with the above change to the error handling for missing objects. Smaller code and virtually no difference in speed. Sold.
2012-02-01 08:16:49 +00:00
Allan Jardine
d8f9e6289e Docs: Add a "dtopt" tag to options that should be documented on the DataTables main site. This allows that documentation to be automatically generated from the source as well as the auto gen developer documentation.
Docs: Fix a few small issues with some of the documentation comments
2012-01-31 12:36:44 +00:00
Allan Jardine
a5d34f2230 Dev: Code size - also in fnSetColumnVis reduce code size with aoData references in the same way as we do for aoColumns. Smaller size and more consistency. All good. 2012-01-31 08:45:45 +00:00
Allan Jardine
4a4b6f6d58 Dev: Get the library size back under the target 70000 bytes. Its a bit of a cheap shoot this one, but every little helps! 2012-01-31 08:42:40 +00:00
Allan Jardine
a0ebd9ffec Dev: Remove the oSettings 'get' in _ - don't need it anymore with the call to fnGetData 2012-01-31 08:33:42 +00:00
Allan Jardine
f436179284 Docs: API: Underscore function documentation updated to take account of allowing TH/TD cells in the selector 2012-01-31 08:32:11 +00:00
Allan Jardine
3e366a5fe9 New: API: fnGetData now also allows TD/TH nodes to be passed in and DataTables will figure out the data for the cell, returning that - easier than calculating the column index yourself. So you can now get the whole table's data, a row's data or an individual cell's data from the fnGetData function (you could get the cell data before, but you would need to use fnGetPosition).
New: API: Underscore function updated to use fnGetData rather than its internal function calls. Although slightly more expensive in computation terms, it extends the capacibabites of the underscore function greatly, allowing TD nodes to be the result of the selector as well as TR nodes. So now you can get a column of data with something like: $('#example').dataTable()._('td:nth-child(4)') . Cool :-)
Dev: New internal function called _fnNodeToColumnIndex, adapted from fnGetPosition for reuse.
2012-01-31 08:09:51 +00:00
Petah
904f5dd672 Allow custom JUI header and footer classes 2012-01-31 14:42:10 +13:00
Petah
05b9ad3d0c Add JUI header/footer classes 2012-01-31 14:39:24 +13:00
Allan Jardine
acfee98b7c Fix: Remove characters 0x80-0xFF. I had a new non-ASCII characters in by mistake and the PHP JSON processor objects to these characters when parsing the output from the JSDoc debug output. 2012-01-30 16:46:05 +00:00
Allan Jardine
876a75f6ad Fix: With scrolling enabled, adding the scrollbar width to the header / footer inner container elements could cause the table to resize incorrectly on the following draw (and this error was cumulative). Fix is not to adjust the inner element for the scrollbar width - makes no difference to the table draw. It is possible that if you've styled this element you might need to take this change into account, but by default DataTables will style the parent (scrollHead) so no change is required (regardless of jQuery UI theming enablement) - 6776.
Fix: The calculation to detect if the scroll bar would be shown in IE6/7 was incorrect - it was calculating the height of the entire table, rather than just the body of the table (i.e. body + header + footer) which caused the "correct" for the scrollbar to be incorrectly applied to small tables.
2012-01-30 09:52:35 +00:00
Allan Jardine
a057b9d8cf Dev: Trivial modification to bring 1.9.0 back under the target size of 70000 btyes (was only 4 out). Simply reference the previous search object to a local variable so the compressor can compress more 2012-01-28 09:22:34 +00:00
Allan Jardine
8c8ddc0485 DataTables 1.9.0.dev.4
Fix: Multiple tables were going haywire on initialisation due to the self reference - 8233
2012-01-25 19:44:05 +00:00
Allan Jardine
937811f09c DataTables 1.9 beta 3 2012-01-25 16:16:36 +00:00
Allan Jardine
9fb4492053 Fix: aoPreSearchCols can be given as null if you want to deinfe multiple columns - doing so would have resulted in an error. Fixed (unit test) 2012-01-25 16:09:41 +00:00
Allan Jardine
5c9ec489c6 Dev fix: Documentation - noted that there were three parameters passed to mDataProp as a function, but only documented two. Add documentation for the third... 2012-01-23 09:55:45 +00:00
Allan Jardine
fc81ce726b Update: mDataProp update to make it more versitile as a function and fix the settings of data with mDataProp. When mDataProp is given as a function, the function is now called with a 'type' of 'set', which the developer using mDataProp must used to store the value that if given (otherwise DOM read values would not be stored!).
Update: mDataProp documentation - example of using mDataProp as a function and clearer information about the options for mDataProp
2012-01-22 10:56:24 +00:00
Allan Jardine
2aea4da8bc New: API method: _ - the underscore function is the compliment to the $ function introduced early in the 1.9 development cycle. While working with DataTables and the $ I've often wanted the data for the nodes that I'm working with, which means a call to fnGetData and an inner look - not itself bad, but it means an area loop in the external code - so this underscore function is basically the same as $, but rathe rhtan returning an jQuery object of nodes it will return an array of the data source objects for the matched TR elements (important to note that - the selector should resolve TR elements only, other elements don't have DataTables controlled data, and thus will be null in the returned array) 2012-01-21 11:08:22 +00:00
Allan Jardine
ea9ebaa593 Dev: Update: _fnNodeToDataIndex can be made _so_ much faster with the new _DT_RowIndex prviate parameter - so this commit does so :-) 2012-01-20 21:58:17 +00:00
Allan Jardine
4812d1d35b Dev: New: _DT_RowIndex is a private parameter that is attached to all TR elements in the table now. This allows fast reverse mapping from the row index to the aoData entry (typically this will be used for getting _aData). Before we would have to loop over all rows which could be very slow, but this reverse mapping allows several new options for optimisations and future enhancements.
Dev: Updated: All fnRender calls have been put into a single point - code reuse...
2012-01-20 21:48:45 +00:00
Allan Jardine
e7bba4bcbe Dev fix: The last change for fnAddData was incorrect - it would mean that objects couldn't be added... 2012-01-20 17:39:37 +00:00
Allan Jardine
139f33603a DataTables 1.9.0.dev.3
Fix: fnAddData - check for 2D array could fail on null, since null is an object type - 8134
2012-01-19 09:36:55 +00:00
Allan Jardine
1421a08b90 Reissuing 1.9.0.beta.2 - the one I tagged before was never released outside me tagging it, since there was no time to write up the release notes, and now with a few more bug fixes, I think they should be rolled into to what will be released as 1.9.0.beta.2 2012-01-15 15:59:38 +00:00
Allan Jardine
80472cdd13 Dev fix: Oops - inverted logic for column filter definitions 2012-01-15 10:45:28 +00:00
Allan Jardine
1e7f3066f9 Fix: A stored display start (iInitDisplayStart) of 0 would cause an undesired effect 2012-01-15 10:43:01 +00:00
Allan Jardine
91c63b8ad5 Fix: When a previous search column details is defined for column 0, it would fail incorrectly. Now fixed 2012-01-15 10:37:43 +00:00
Allan Jardine
acec127c9a Fix: Backwards compatibly for fnGetData and fnGetNodes when the row (as an integer) is not available 2012-01-15 10:30:48 +00:00
Allan Jardine
0c3dadbed9 Fix: fnOpen - when passed a TR element (or indeed any other element) that is not part of the master table (i.e. under control of DataTables), DatTables would try to "open" the row anyway - which was wrong. So now check that the node given is a TR element under control of DataTables, otherwise silently return. This is useful for using fnOpen when bound to all TR elements in the TBODY with a live event handler (i.e the click would also occur on the opened row). 2012-01-15 10:09:06 +00:00
Allan Jardine
e1146e2f9d Fix: _fnGetTdNodes would error if trying to get only the first row 2012-01-15 09:32:05 +00:00
Allan Jardine
dbf87ff5cd Performance: MUCH faster removing of DOM elements in the header and body of the table - 8060 - performance testing: http://jsperf.com/remove-detach/11 2012-01-14 09:48:52 +00:00
Allan Jardine
1077ebcf08 Performance: there can only be 1 open row per parent TR, so quit out the loop when found - 8060 2012-01-14 09:38:19 +00:00
Allan Jardine
7f90aff469 DataTables 1.9.0.dev.3 2012-01-14 09:37:26 +00:00
Allan Jardine
517a3a3663 Updated: Minor change to fnOpen to be more flexible for jQuery input - 2488 2012-01-12 07:02:22 +00:00
Allan Jardine
b67c0969de DataTables 1.9 beta 2 :-) 2012-01-10 15:34:55 +00:00
Allan Jardine
91c8547f48 Fix: Couple of trivial optimisations for speed and size 2012-01-10 14:35:18 +00:00
Allan Jardine
cfb77fd569 Fix: Documentation for fnStateLoad 2012-01-10 14:30:00 +00:00
Allan Jardine
9fb75b1f03 Small tidy ups in the new css files 2012-01-08 20:57:17 +00:00
Allan Jardine
7eb80ac7e9 Dev change: For jQuery convention, call the DataTables CSS file jquery.dataTables.css (and similar for themeroller compatible file)
New: Base demos using the two new stylesheets
2012-01-08 20:53:42 +00:00
Allan Jardine
f1de176d65 New: Base CSS for ThemeRoller 2012-01-08 20:28:15 +00:00
Allan Jardine
e369551a75 New: Basic CSS for creating a DataTable - similar to what is in the demo_table.css file but doesn't have all the bits and bobs needed for the demos (which could conflict with other elements on the page or are just wasted bandwidth). This file is suitable for distibution on a CDN. Ultimatly this should replace the majority of what is in demo_table.css (that should basically become "examples.css") and become the main file in the distribution for CSS. Will probably need a JUI version as well. 2012-01-08 20:06:33 +00:00
Allan Jardine
25d5ab4bed Fix: fnGetData returning all rows when trying to get row 0 2012-01-08 09:52:41 +00:00
Allan Jardine
7ae342dc7d Fix: Unable to set an sDom default if bJQueryUI:true is used 2012-01-07 16:58:58 +00:00
Allan Jardine
b689320911 Fix: In browsers that don't define JSON then there woudl be an error thrown 2012-01-07 13:31:57 +00:00
Allan Jardine
2f729af697 Fix: Made a mistake when updating the conditionals for fnFilter and fnGetData when considering rows. if ( 0 ) is of course false - so passing in an integer isn't valid - need to check for undefined - 7997 2012-01-07 12:55:28 +00:00
Michal Poreba
bedec19423 fix to fnAddData ignoring the default bRedraw=true
Signed-off-by: Michal Poreba <michalporeba@gmail.com>
2012-01-06 11:46:39 +00:00
Allan Jardine
6fbda0a08f Updated: Remove the min-height on the table wrapper - it is a lot more hassle than it is worth now and just keeps getting in the way - 7971 2012-01-03 14:47:37 +00:00
Allan Jardine
9809d71161 Dev update: Use $.extend to copy arrays and objects for the state savings, as we don't want plug-ins to be able to muck around with the DataTables internals by mistake (even with the slice, the objects in the arrays maintain their references) 2012-01-02 19:59:52 +00:00
Allan Jardine
a4c7ac222a Its 2012 now :-) 2012-01-02 10:42:43 +00:00