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

270 Commits

Author SHA1 Message Date
Allan Jardine
9a94759fa4 Override the default sDom when using jQuery UI 2011-12-11 08:51:03 +00:00
Allan Jardine
a41a68d91d Don't include duplicate classes - just extend the base for the jQuery UI version 2011-12-11 08:50:34 +00:00
Allan Jardine
d9e02ab5c8 Pull the Ajax functions into their own file 2011-12-11 08:44:28 +00:00
Allan Jardine
e5816e381c New: fnPageChange will now accept integers as well as the four current strings. The integer given represents the page that the table should jump to. Also update the internal calls to use this new ability as it is cleaner. 2011-12-11 08:41:55 +00:00
Allan Jardine
0d772b5eba Always add an ID to a table if it doesn't already have one
Add a class to the table to identify it as a DataTable
Update setAttribute to use id - works just as well and slightly smaller
2011-12-11 08:27:41 +00:00
Allan Jardine
d0458ca22c First effort at ARIA support - the table control widgets link themselves to the table now ('controls') and the column headers say what they do. The table is also described by the information control. Note that an ID on the table is needed for most of this, since ARIA can reiference elements. 2011-12-10 11:34:30 +00:00
Allan Jardine
8eb722271e Update the styling of the default pagination to make it more attractive. Also remove the previous change to use A tags - concerned about backwards compatibility and developers needing to update styles. Impact on accessibility to be evaluated, when ARIA button roles are added. 2011-12-10 10:33:00 +00:00
Allan Jardine
224b3b0661 Documentation changes, suggested by Michael Mathews (author of JSDoc). Generated documentation for DataTables should now be more or less complete. 2011-12-09 08:33:45 +00:00
Allan Jardine
23993219d7 Trivial change to the full numbers conditional logic. Its the same logic as before, just more sensibly laid out. 2011-12-08 11:39:51 +00:00
Allan Jardine
e2ac47b675 Had broken API extension methods... There was a bit of confusion between oApi as an internal variable and as an external variable. This commit effectively brings them together - you can access the internal functions as regular API methods now - although that might not be a particularly good idea just yet - not to be documented until I'm happy with this. 2011-12-08 10:53:22 +00:00
Allan Jardine
d4366df398 Change how the state loading callback functions operate - previously it would require that a cookie be available before the state loading callback is called. Now is state loading occurs at all the callback function will be fired - allowing easer integration with server-side state storage. I don't actually see a downside to this and it should be perfectly backwards compatible. 2011-12-08 09:51:40 +00:00
Allan Jardine
1550b37c79 Tidy up the pagination functions a bit - lass code and easier to understand 2011-12-07 18:33:59 +00:00
Allan Jardine
7a42b450db New: fnFormatNumber is now also called for the full numbers pagination elements where a number is displayed. This now means that all numbers displayed by DataTables go through fnFormatNumber - 7441 2011-12-07 11:40:37 +00:00
Allan Jardine
f535031e41 New: Use localeCompare to do string comparison, allowing much better internationlisation support for sorting strings in DataTables 2011-12-07 11:07:02 +00:00
Allan Jardine
66a2e3d659 Experiment with tabindex on the sorting headers and the pagination buttons. More to follow... 2011-12-07 10:24:03 +00:00
Allan Jardine
d210865c83 Correct link for initialisation options 2011-12-06 18:08:13 +00:00
Allan Jardine
bfd625350c One thing that has bugged me a little since I first wrote DataTables was that for some mental reason I picked $.fn.dataTable rather than $.fn.DataTable as the jQuery access function. This commit now allows either approach. 2011-12-06 18:04:57 +00:00
Allan Jardine
d8132799f7 Update internal variable names - rather than using the local private variables _aoSettings and _oExt, these are now attached to the DataTable object as static parameters. Cleaner and will document easier as well. 2011-12-06 18:03:29 +00:00
Allan Jardine
a22727c84b Remove trailing commas! 2011-12-06 16:44:17 +00:00
Allan Jardine
bccc85ef9f New: For plug-in authors, the internal function _fnApplyColumnDefs has been created and made available to make it much easier to present aoColumns and aoColumnDefs options for plug-ins (the names of the parameters can be whatever you want). Basically the function will take each of the two arrays (or null if not available) and figure out what definations should be applied to what columns - and then callback to a function that will apply the configuration (specific to the plug-in). This is now also used for the DataTables aoColumns and aoColumnDefs. 2011-12-06 16:05:53 +00:00
Allan Jardine
d6d24275df Fix: If there is an sClass defined for a column, and a footer element for the column, apply the sClass to it, just as we do to the header. 2011-12-06 15:11:14 +00:00
Allan Jardine
a264ca66e9 New: fnCreatedCell option for columns - this function is a compliment to fnRender, but in this case it is called when the cell is available (unlike fnRender). This allows DOM manipulation of the cell (or possibly the row as the parentNode if you so wished), such as adding a cell based on the cell data, or any other DOM manipulation. 2011-12-06 14:48:49 +00:00
Allan Jardine
b0d5255de9 New: $ API method for performing a jQuery selector on the TR elements in the table's body. Provide options to adjust the filtering, sorting and paging results with sensible defaults. This will make manipulating the table for styles, events etc much easier. 2011-12-06 12:09:38 +00:00
Allan Jardine
b4a289bf36 Limit the span modification for the sort classes - from pull request 40 (https://github.com/DataTables/DataTables/pull/40). 2011-12-06 11:24:35 +00:00
Allan Jardine
c6d1dfd929 New: New API method: fnIsOpen - to work with fnOpen and fnClose, allowing a quick check to see if the row is currently open or not. 2011-12-06 11:05:58 +00:00
Allan Jardine
07c3d3f5a6 New: Add an optional parameter to fnDestroy that will cause the table to be completely removed from the DOM, as well as unbinding events etc (the default is the original behaviour, which is to reinsert the table into the DOM where it was originally located) - 7523 2011-12-06 10:52:56 +00:00
Allan Jardine
77c551268e Change: Add a parseInt to the two integer values that come back from server-side processing. The question about why it doesn't work when strings are returned (or rather, why is it broken) keep cropping up in the forum. 2011-12-06 10:44:18 +00:00
Allan Jardine
5f53331cd6 New: Accessability change - use A tags rather than DIV/SPAN for the pagination buttons. This is a backwards incompatible change, but a sensible one 2011-12-06 10:39:22 +00:00
Allan Jardine
30e018f398 Fix: Cast fnFilter input to a string always - since we are always going to treat it as a string 2011-12-05 17:20:53 +00:00
Allan Jardine
2928326042 Tidy up the initialisation code a bit for creating the settings object and integrate the language compatibility fully 2011-12-05 16:36:20 +00:00
Allan Jardine
9dc702329d Fix: It appears that the latest Webkit browsers have changed their scrolling behaviour slightly, which is causing the unit tests to fail. Basically the 'scroll' event is being fired when the infinite scrolling table is having data written to it (i.e the scroll changes - so its kind of fair enough!), so add a check to only load the first set of data when there is no scrolling applied. 2011-12-05 10:00:40 +00:00
Allan Jardine
6a7a7151b8 Alter the extending of the initialisation parameter with the defaults a little such that objects are deep copied and arrays are not (code needs tidied a little - want to get it passing all unit tests first). The thing here is that we can't use jQuery's $.extend for a full deep copy since we don't want to deep copy arrays (for example aaSorting, where the default sort would always be applied), but we do want to deep copy objects (and not just take a reference to the default object). Thus we can't use $.extend :-(. 2011-12-05 09:21:20 +00:00
Allan Jardine
6205de54a4 Fix numeric sorting pre-formatting method typo, picked up by the unit tests 2011-12-03 09:56:46 +00:00
Allan Jardine
ee47cb7518 Add and document the extension object for DataTables. The extension object (ext) allows plug-ins to be added to DataTables (and is also used for this internally as well). 2011-12-03 09:36:19 +00:00
Allan Jardine
e5b826c434 Rearrange the 'ext' option and make the base object a model so it can be readily documented. More documentation required for the model to explain what each of the options does 2011-12-02 07:22:57 +00:00
Allan Jardine
e86da5d30a Only need to define oApi once... 2011-12-01 19:58:34 +00:00
Allan Jardine
c491f8a37f Add examples to API methods and tidy up the way oApi is generated a little 2011-12-01 19:47:40 +00:00
Allan Jardine
aeedb9afdc Internal and API methods now use JSDoc comments rather than my old system 2011-12-01 17:53:59 +00:00
Allan Jardine
5c67be62ae Use the oSearch model for the default initialisation and column initialisation 2011-11-27 18:51:56 +00:00
Allan Jardine
3ddd89b52e Add JSDoc comments for the DataTables settings object 2011-11-27 17:50:06 +00:00
Allan Jardine
133e7fb7fe Fix various comment spelling mistakes 2011-11-26 18:51:45 +00:00
Allan Jardine
b6e60beef5 iNextId can go the same way as _iId since that is all it was needed for 2011-11-26 14:13:50 +00:00
Allan Jardine
eb6bde7e08 Drop "_iId" from the row model - its not used anywhere in DataTables these days. An old legacy property from the 1.3 days I think - can't imagine any third party plug-ins use this property either - its more or less useless these days. 2011-11-26 14:06:55 +00:00
Allan Jardine
d5e5d31725 Document the row model and update the data methods to extend this model as the base for aoData 2011-11-26 14:04:58 +00:00
Allan Jardine
cc265bcb09 Add defaults for aDataSort and sServerMethod (the two new parameters that have been introduced since the last release) 2011-11-26 13:45:08 +00:00
Allan Jardine
dcf88a2609 Tidy up the constructor to take account of the fact that we now have every possible property in the initalisation objects, since it is being extended from the details - i.e. no need to check for 'undefined' any more. 2011-11-26 13:34:51 +00:00
Allan Jardine
d20b87f885 First pass are using $.extend for the settings and initialsation objects.
Back into a state where the zero config will work
2011-11-25 17:08:21 +00:00
Allan Jardine
626492b81c Big change to how DataTables constructed in the file system - breaking the various parts of DataTables seperate files. This is probably the biggest individual change to DataTables since it was first written, but the code itself is more or less the same - just split out into different files. The one big change to the code thus far is to change the function classSettings into an object that is extended. More work is required on this to complete the alteration, but for now DataTables is building into the same workable form as before using the new make.sh file. 2011-11-24 14:05:22 +00:00
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