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