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

696 Commits

Author SHA1 Message Date
Allan Jardine
419ad58d0b DataTables 1.8 beta 3 2011-05-14 10:58:24 +01:00
Allan Jardine
3ae5367ddc Dev fix: Committed test case my mistake - reverting 2011-05-14 10:58:00 +01:00
Allan Jardine
7bef3d19b4 Fix: Tidy up the fnGetPosition API method and allow it to cope with getting a TH cell's position in the table as well as TR and TD elements. The input and output options for the function have not changed - just it's internal operation. 2011-05-14 10:48:14 +01:00
Allan Jardine
c56c84683c New: fnUpdate has been updated (oh the irony) to accept either an individual value, an array or an object as the first parameter passed to it. The individual and array options behave exactly as they did before this change - the new option is the object being passed in. This allows fnupdate to be given a data object which is identical to data objects used by the table when using complex objects and mDataProp. How fnUpdate itself actually operates has also changed to be self calling, which makes the multipe column updates for arrays and objects much easier.
Fix: fnUpdate now works with TH elements in the body as well as TD elements
2011-05-14 10:35:57 +01:00
Allan Jardine
8eafb87f1e New: New callback function fnPreDrawCallback which is called at the very start of each table draw (so rather like fnDrawCallback, just before the
draw!). This function is, like all other DataTables callbacks, execuated with the DataTables instance scope, and also takes a single parameter -
the DataTables settings object. The attached function can cancel the draw by returning false, anyother return (including undefined) results in the
full draw occuring).
2011-05-13 10:27:15 +01:00
Allan Jardine
a84eec581b New: New language option sLoadingRecords which is used when the table's data is Ajax sourced, and at the first draw only. This provides an
indication that the data is currently being sourced from the server (i.e. Loading...) rather than showing 'No data available in table' - which is
not particularly friendly. Note that for server-side processing, DataTables will leave whatever is in TBODY when it makes the first Ajax request,
so with server-side processing you would need to put in a TR/TD into the static HTML table.
2011-05-13 10:19:29 +01:00
Allan Jardine
9cf1ff785e Dev fix: The insertBefore for column visibility was incorrect if the next column was hidden as well. Need to 'fast-forward' to the next visible column to get the insert point. 2011-05-13 06:38:56 +01:00
Allan Jardine
844bbaf4ee Fix: fnSetColumnVis didn't cope with TH elements in the body due to the use of a 'td' selector. The fix for this is to use _fnGetTdNodes() (since that can get an array of TD|TH nodes, which in turn allows a nice tidy up of the insert part of the function. 2011-05-12 21:34:48 +01:00
Allan Jardine
f27c487862 Fix: fnSetColumnVis was broken when used with deferred rendering due to the offset calculation done with the huge flat array of TD nodes. The fix is to simplify this somewhat and get an array for each row (when it is available) and process that using the optional parameter for _fnGetTdNodes. This doesn't result any any extra computation time, other than the addional time to call the function (but not to execute it), since it is just moving where the loop is. 2011-05-12 20:46:33 +01:00
Allan Jardine
97386476c8 Fix: A couple of little jslint tidy ups 2011-05-12 20:37:35 +01:00
Allan Jardine
99b674def8 Fix: New algorithim for calculating the column widths for a table when x-scrolling is enabled. Basically browsers need a bit of a hand when a width is assigned to any columns when x-scrolling as they tend to collapse the table to the min-width, even if we sent the column widths. So we need to keep track of what the table width should be by summing the user given values, and the automatic values 2011-05-12 20:32:18 +01:00
Allan Jardine
84a1940cad Fix: Passing an integer for sWidth would cause the column width calculations to go completely off since they weren't actually used by the browser. Make use of the _fnStringToCss helper function for exactly this kind of thing. 2011-05-12 20:29:24 +01:00
Allan Jardine
0c493b6789 New: New column option - sContentPadding. What this option does is tag on an extra string to the content of the columns in the width calculation table, in order to take account of the fact that 'iii' is actually less wide than 'mm', but DataTables will pick 'iii' as the longer due to the string width. With sContentPadding you can add an extra string to any column to force DataTables to take account of this during the width calculation - the string in sContentPadding is not used anywhere else and is empty by default. This option will remain undocumented for the moment, since I suspect it will confuse more than help, but it is very useful to have around when x-scrolling. 2011-05-12 20:23:40 +01:00
Allan Jardine
fcc41bc535 Fix: When calculating the string width for column sizes, we know that we are going to be using strings for the display - so cast as a string, which means that we can take the length of any primitive (particularly numbers).
Fix: The max string width calculation was including HTML, which is just plain wrong since the HTML will be hidden. This is still not perfect since "iiii" takes less space than "mmm" in the browser display, but addressing that would take some serious clocks cycles, and this is good enough for now.
2011-05-12 20:18:48 +01:00
Allan Jardine
dd0e4023f0 Fix: _fnGetTdNodes works on a column data array basis, not visible columns, so _fnGetWidestNode need only deal with column indexes. It was possible before that the width calculation would be done in the wrong column if using hidden columns 2011-05-12 20:14:29 +01:00
Allan Jardine
c8c10d1fba Fix: fnGetData should give the original data object, rather than the array that DataTables uses for rendering the actual table. This was part of the original commit for the 1.8 object handling, but in retrospect, the original data is much more useful. 2011-05-12 20:11:11 +01:00
Allan Jardine
b3f5ddaf96 Fix: When calculating the column widths, we should get the data to display, otherwise a null element (particularly when using a null mDataProp) can
cause issues with columns being skipped (due to the null return)
2011-05-11 08:53:33 +01:00
Allan Jardine
275c7520db Fix: When using fnRender with a null mDataProp, although the rendering function was called, it wasn't actually saved anywhere. This meant that when the cell was actually created and the data source attempted to be read, the rendered string wasn't available - thus you got an empty cell (4943). This fix is to add a condition to the rendering call to delay until the node is created. Note that there is still a quirk here, in that the rendered data cannot be used for sorting or filtering, since again it isn't stored anywhere when the data source is null. 2011-05-10 06:38:17 +01:00
Allan Jardine
3464502c06 New: sDefaultContent property for aoColumns / aoColumDefs. This new property allows a default value to be given for a column's data, and will be used whenever a null data source is encountered (this can be because mDataProp is set to null, or because the data source itself is null). In addition to this, when set if the mDataProp value is undefined, the default will be used instead (and no error given). If sDefaultContent is not set (default is null), and the mDataProp value is undefined, an error will be given as it currently is. 2011-05-09 19:07:16 +01:00
Allan Jardine
341f6784f6 Fix: null data should be returned as an empty string for HTML display 2011-05-09 18:24:23 +01:00
Allan Jardine
d242d9cad4 Dev fix: The last commit for fnUpdate wasn't quite complete - this commit is the correct one. Updating fnUpdate to be able to cope with bDeferRender 2011-05-09 18:06:52 +01:00
Allan Jardine
d073e36c34 Fix: fnUpdate needs to consider null nTr rows for deferred rendering 2011-05-09 17:53:06 +01:00
Allan Jardine
c125efebc9 Fix: When using bDeferRender HTML in the target cell would be used as text rather than HTML when doing the width calculations - making them completely wrong - 4879 2011-05-09 17:47:18 +01:00
Allan Jardine
c8572df07a Start 1.8 beta 3 development
Backwards compatibility change: Use the get data function to cast data as a string when being used for display
2011-05-09 07:19:54 +01:00
Allan Jardine
c5b085091b DataTables 1.8 beta 2 release 2011-05-08 18:59:09 +01:00
Allan Jardine
5576cf2097 Dev fix: fnRender is only called once per row now for Ajax sourced data 2011-05-08 18:58:34 +01:00
Allan Jardine
04aa89337b Dev fix: Tidy up modifications to the _fnGetTdNodes function 2011-05-08 18:40:02 +01:00
Allan Jardine
1d651f68a3 Fix: The change in commit 537e3e9595 (537e3e9595 ) was incorrect - the column widths should be calculated with width() rather than outerWidth(). This can be seen by the misalignment in the tmp table if it is made visible. 2011-05-08 15:40:03 +01:00
Allan Jardine
2c2a4754d9 New: Add paginate_button_disabled to buttons which cannot be clicked on in full_buttons pagination, when not using jQuery UI themeing to make styling easier 2011-05-08 11:25:28 +01:00
Allan Jardine
4eb344cc1a Fix: When calculating the width for tables, need to consider TH elements as well as TD in the body. Also correctly consider complex headers 2011-05-08 07:51:36 +01:00
Allan Jardine
96d0b163ce Fix: When a column of only TH elements is used in the table it would cause indexing problems for the width calculation due to a getElementsByTagName('td'). Now use the _fnGetTdNodes (slightly modified) to do this. 2011-05-07 10:37:22 +01:00
Allan Jardine
e4390f8b00 Fix: When defered rendering was on and sort classes off, the header sorting classes weren't being appled - 4927 2011-05-07 09:36:04 +01:00
Allan Jardine
b52665fd6b Fix: Allow non string and numeric data types in the data source (including null and boolean etc). Add suitable unit tests to sanity check this. 2011-05-04 19:21:41 +01:00
Allan Jardine
fa85d34b24 Fix: Update Ajax data source demo with new location for the data source file 2011-05-04 18:37:25 +01:00
Allan Jardine
06d1802874 New: Support TH elements in the table's TBODY. TH elements are now treated just like TDs in the body. This will work only with DOM sourced data out of the box - any body cell elements that DataTables creates are still TD. 2011-05-04 18:30:44 +01:00
Allan Jardine
d4b8495378 Fix: The construct <tfoot><tr></tr></tfoot> would break the new table header/footer draw. While strictly this isn't valid HTML, 1.7 and before allowed it - so adding a condtion here to allow it in 1.8 as well 2011-05-03 17:40:42 +01:00
Allan Jardine
2c8868dd53 Update version number to 1.8.0.dev.2 for beta 2 development work
Fix: Call fnRender only once when using using bUseRendered (don't need to call it twice since our internal data cache already has the rendered value stored) sin
ce this can cause some confusion with re-writing the data source value - 4871
2011-05-02 22:32:54 +01:00
Allan Jardine
68667a0ee9 Start 1.8 beta 2 development
Fix: Update readme for 1.8
2011-05-02 22:28:41 +01:00
Allan Jardine
fa364b57d5 DataTables 1.8 beta 1 2011-04-27 22:05:57 +01:00
Allan Jardine
144bd6e178 Dev update: Change the name of the custom data property for Ajax sourced data 2011-04-27 22:05:00 +01:00
Allan Jardine
ee3a7a6b89 Dev update: Remove dead code 2011-04-27 21:50:45 +01:00
Allan Jardine
f3bd978b8f Dev fix: Clean up the calls to _fnDrawHead 2011-04-27 19:18:08 +01:00
Allan Jardine
e8e30c35e0 Dev change: Put nTf back into aoColumns - it's actually quite useful! It is not maniditory that there need be a cell for every column however - the footer is a lot more relaxed than the header 2011-04-27 18:06:29 +01:00
Allan Jardine
ed00eac7f5 Updated: Update the links on all examples to include the new examples for 1.8 and general tidy up of examples 2011-04-26 07:30:31 +01:00
Allan Jardine
a9b9dc4ffe New: New examples for the various features of DataTables 1.8 2011-04-25 19:07:57 +01:00
Allan Jardine
198222d8d6 Dev fix: Read row ID/class from _aData 2011-04-23 11:44:09 +01:00
Allan Jardine
e2f31c5a13 Dev update: Automatic additio of ID and class should be done in the create TR mthod 2011-04-23 11:39:18 +01:00
Allan Jardine
e9adba0802 Dev change: mDataSource renames to mDataProp. Reason for the change is that in future we could have mSortProp and mFilterProp if we wanted to sort / filter on something other than the main data. Also we are refering to a property of the source object (or an index of the source array - hence keeping the 'm' prefix) 2011-04-23 10:38:00 +01:00
Allan Jardine
1f681d81ac Dev fix: Again with the destroy... 2011-04-23 09:00:37 +01:00
Allan Jardine
707953a285 Fix: fnDestory would put the table back into the DOM in the wrong place if the table wasn't the the only (or last) element in the parent (i.e. it was just doing an append) - 4751 2011-04-23 08:58:58 +01:00