Allan Jardine
1f02ac87fc
Fix: Filtering doesn't deal with carriage returns - 6313 - thanks to Jonathan Camp for this fix.
2011-11-23 07:28:16 +00:00
Allan Jardine
2c14233057
New: Optimisation for sorting - when the sorting runs it will execute the sorting function a lot, particularly for large tables, so we want these functions to be as fast as possible. As it stood, each time the function ran it would prep the data and then do the required comparison - and it would do that data prep every time. This is pointless since toLowerCase (for example) is always going to give the same result when using the same input - so now introduced a third sorting function type (in addition to 'asc' and 'desc') called 'pre', which will pre-format the data to be sorted, only once for each item to be sorted, allowing the sorting comparison function itself to be really fast (simply just the comparison). This is also backwards compatible, if the sorting type doesn't have a 'pre'-formatting method then it will just use the two sorting functions as normal.
2011-11-19 09:53:11 +00:00
Allan Jardine
a1b33880c6
New: aDataSort parameter for columns - this allows a column's sorting to take multiple columns into account when doing a sort. For example first name / last name columns make sense to do a multi-column sort. Previously in DataTables you would need to have the user do a multi-column sort themselves (with shift), but now you can define aDataSort (for example aDataSort: [ 0, 1 ]) to do effectively a multi column sort. Note that this is not shown to the end user that this was a multi-column sort in the same way that iDataSort wouldn't indicate that it could sort on a different column (if that was configured). Also note that iDataSort is still available for use and has not been modified externally, but if aDataSort is defined it will be given priority over any iDataSort parameter.
2011-11-18 16:21:44 +00:00
Allan Jardine
edabb3febe
Dev fix: Oops - committed code from a test to the zero config example!
2011-11-18 16:17:32 +00:00
Allan Jardine
967e1419c1
Modified: The 'i' counter that was in the sort loop was outside the function scope, so the JS engine would need to go back up a level in its scope chain. Not a big thing, but any speed in the sorting function is welcome
2011-11-18 16:01:43 +00:00
Allan Jardine
4c48650a25
New: Pass the cell read 'specific' type to mDataProp if it is given as a function. This might seem like a really simple change, but it greatly expands the flexibility of DataTables. It means that for a column, if you define this function and switch between the four 'get' data types for the cell ('display', 'type', 'filter' or 'sort') you can use different data for each one. So for example you could display a formatted number but do sorting on the numeric version of the number, and filtering on both types (so the user can type either version). The "type" option is for DataTables' type detection. Most of the framework for this was in 1.8.0 - I had thought to include options such as mFilterData (and might in future), but this is the first step to do that without introducing much overhead.
2011-11-14 08:34:29 +00:00
Allan Jardine
30a437d80e
Fix: fnUpdate recursion would cause an error if dealing with nested arrays - 7292. Fix is to let the function know, with a private variable, that it is being called recursively.
2011-11-10 08:15:03 +00:00
Allan Jardine
42567c9968
New: New API method '$' which will perform a jQuery selector action on the TR elements from the table's TBODY, regardless of paging. For example: oTable.$('#allan').css('background-color', 'red') will find the element (TR, TD or anything else) which has an ID of 'allan' and perform the css action on it. This is potentially a much nicer interface than needing to use fnGetNodes. Still more to be done, such as options to take column visibility, ordering and filtering into account, but this might be the tipping point for calling it 1.9 :-)
2011-11-09 08:58:24 +00:00
Allan Jardine
58f85fc601
New: Add "sServerMethod" initialisation option to make it easy to change from GET to POST for server-side requests. Needing to supply a custom fnServerData just to get POST was a bit of a pain - this is now no longer needed. In theory fnServerData should generally not be needed now (with fnServerParams, mDataProp and this new parameter making set up much more flexible).
2011-11-09 08:50:30 +00:00
Allan Jardine
9639d4f485
Merge branch 'master' of github.com:DataTables/DataTables
2011-11-08 10:13:47 +00:00
Allan Jardine
af16d8016c
Don't initialise the xhr listener if there is no DataTable on the page
2011-11-08 10:13:03 +00:00
Allan Jardine
5adb634a25
Merge pull request #37 from mbp/typo-fix
...
Fix typo 'destory' -> 'destroy'.
2011-11-07 00:59:03 -08:00
Morten Brix Pedersen
5732f4c1fa
Fix typo 'destory' -> 'destroy'.
2011-11-07 09:55:01 +01:00
Allan Jardine
f46a49f7f4
Updated: jQuery 1.7 time - DataTables passing all unit tests with the new jQuery
2011-11-04 19:46:41 +00:00
Allan Jardine
8d595eff37
Merge branch 'master' of github.com:DataTables/DataTables
2011-11-01 12:10:22 +00:00
Allan Jardine
9b0bc1bbf9
New: Update SyntaxHighlighter to include a submit button to run the example directly in JSBin (live.datables.net)
2011-11-01 12:09:08 +00:00
Allan Jardine
49a2c1d427
Merge pull request #32 from ghostd/master
...
fnDestroy does not remove all jQuery UI markup
2011-10-15 11:17:44 -07:00
Allan Jardine
b68073b911
Dev change: Slight modification of the code for getting the Ajax source property for Ajax sourced data and server-side processing to save a few more bytes :-)
2011-10-15 09:04:48 +01:00
Allan Jardine
1ae7f81a11
Dev update: Slight modification of style for the inner functions in the pagination controls
2011-10-15 09:01:27 +01:00
Allan Jardine
841480fa59
Merge pull request #34 from thegrandpoobah/pagination_events
...
Apply some DRY to pagination extension code
2011-10-15 00:32:31 -07:00
Sahab Yazdani
4b1b4626a5
Same thing for two button pagination control
2011-10-14 15:13:13 -04:00
Sahab Yazdani
ba02adc6e9
DRY for the four event handlers
2011-10-14 14:47:20 -04:00
Vincent Ricard
1d8deed379
fix DataTables #30
2011-10-10 14:23:34 +02:00
Allan Jardine
f9f6031321
Fix: Function name in comment for fnSetColumnVis was wrong
2011-10-08 20:09:03 +01:00
Allan Jardine
896a8dc0fc
Merge branch 'master' of github.com:DataTables/DataTables
2011-09-30 19:44:18 +01:00
Allan Jardine
7e9d5eb537
Examples: Add JSONP examples for the 'id's and 'objects' sever-side scripts. Might make all JSONP compatible at some point...
2011-09-30 19:42:09 +01:00
Allan Jardine
efa3209654
Fix example: Need element scope to calculate TD index! - 6647
2011-09-20 19:37:17 +01:00
Allan Jardine
f175f3658e
Fix: Calculating the width of a table can be incorrect when the calculation table is hidden due to an issue with jQuery's
...
width/outerWidth calculation (http://bugs.jquery.com/ticket/9945 ). This is a bit of a work around to get the css value and check if it is
a percentage - this is not perfect (since other relative values aren't checked - although they are generally unlikely to be used), but it
is effective for most cases.
2011-09-16 08:45:00 +01:00
Allan Jardine
437ac29048
DataTables 1.8.2 :-)
2011-09-10 10:35:54 +01:00
Allan Jardine
c655c92cfe
Fix: Unit test compatibility fix for IE7
2011-09-10 10:35:03 +01:00
Allan Jardine
5f82b240bc
New: If a data source is found to be a function, then the function is executed and the return used for the cell display (+sorting, filtering etc). This is useful for integration with knockout.js and backbone.js etc.
2011-09-10 09:12:23 +01:00
Allan Jardine
1d2db4d5e9
New: All examples which show Ajax requests now show the JSON response from the server (highlighted to be readiable JSON formatting) and the responses shown will update with each additional request. The idea is to make the formatting that DataTables expects / can cope with more obvious
2011-09-10 08:53:02 +01:00
Allan Jardine
e32312be0b
Dev fix: The new custom events will always pass the DataTables settings object as the first parameter
2011-09-10 08:05:51 +01:00
Allan Jardine
22cb3edef7
Update to latest jQuery - 1.6.3
2011-09-10 08:00:39 +01:00
Allan Jardine
8a8ca1e7b8
New - experimental: Add custom events into DataTables - the events available are "draw", "filter", "sort", "page" and "xhr". These are very useful for knowing when these actions happen and binding an action to them. Useful for plugin developers and developers using DataTables both. Note that it would be possible to put in a _LOT_ more custom events ("predraw" etc) which is why this feature is currently considered experimental. It will not be documented in the DataTables documentation until this has stabilised (likely 1.9 or 2.0) and a scheme has been fully confirmed for these events, but I want to include them now to see if and how they are used by developers to see them or talk to me (as this has been asked for a few times). I'm also slightly concerned about the overhead that would be generated if there were custom events for everything.
2011-09-10 07:59:44 +01:00
Allan Jardine
31ccd959bc
Dev fix: Remove the UTF8 BOM which had somehow found its way in. No need for it here and it was upsetting JSLint...
2011-09-09 19:39:21 +01:00
Allan Jardine
5131e1dd7f
Fix: HTML column type could sometimes be overridden by the string sorting type. If a cell was found to have just a string and no HTML in it then the whole column would be treated as a string column, even if other cells had HTML. Now put a check in place to ensure that string can't overrule html type. Unit test added.
2011-09-09 19:32:59 +01:00
Allan Jardine
856bef205d
Fix: In webkit browsers the cursor in the active filter would always jump to the end of the input string due to an incorrectly matching elements (after the introduction of the label tag for the filter). Use a jQuery selector to make this more robust.
2011-09-09 09:06:50 +01:00
Allan Jardine
4c501bd2d8
Dev fix: Can't use '>' in the children() method for jQuery since it would try to match on the wrong elements. Need to add another 'children' call.
2011-09-09 08:44:52 +01:00
Allan Jardine
826545f1e5
Dev fix: Mistake with the legacy support for asStripClasses and its typo change to asStripeClasses. Would never accept the old spelling.
2011-09-08 17:47:55 +01:00
Allan Jardine
8fd5311d9e
Fix: Due to the jQuery $('>...') selector syntax being deprecated, change the format to use the 'children' option instead
2011-09-08 17:39:24 +01:00
Allan Jardine
ad104832d8
Fix: Nested tables in the the main table's header wold cause an error due to too many TR elements being selected by the header detection method. We want to pick up only the child elements of the header - 6485
2011-09-08 17:12:23 +01:00
Allan Jardine
a444026985
New: In the syntax highlighting also pickout DataTables' API methods and link them to the reference page
2011-09-05 19:24:18 +01:00
Allan Jardine
f788dd28d3
New: Syntax highlighting for the examples and provide a link for DataTables initialisation options to the reference page
2011-09-05 19:14:02 +01:00
Allan Jardine
9f171bbd7e
Fix: Backwards compatibility for the init parameter asStripClasses with the spelling correction to asStripeClasses. asStripeClasses should now be used, but asStripClasses can be used. If both are given, the newer one will be used in preference to asStripClasses.
2011-09-04 10:04:46 +01:00
Allan Jardine
922e1ddc8b
Merge pull request #24 from Survos/master
...
correct "stripe" spelling
2011-09-04 02:01:38 -07:00
Keith C. Ivey
505335b796
correct "stripe" spelling
2011-09-02 11:33:10 -04:00
Allan Jardine
0c296ca76e
New: fnServerParams callback function - this allows additional parameters to be added to the XHR for server-side processing or Ajax sourced, client-side processed data, with ease. Previously it was required to override the fnServerData method just to add a couple of parameters, but the built in fnServerData method is quite comperhensive and you don't want to have to reproduce all of that unless you need to. Now you don't need to :-). fnServerParams is called on each request, so it is ideal for adding extra parameters such as search parameters which can be updated by users.
2011-09-02 16:01:56 +01:00
Allan Jardine
4708870aa0
Changed: Use $.extend for the language options - its quicker and easier! The init options should be done like this as well, but that will likely be 2.0 due to the way it is currently implemented...
2011-08-30 18:27:12 +01:00
Allan Jardine
e87798781b
New: Add a thousands seperator option to the language options. As a displayed string in DataTables this should be configurable, and now is with the oLanguage.sInfoThousands options ( "oLanguage": { "sInfoThousands": "'" } for example).
2011-08-30 18:20:59 +01:00