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

128 Commits

Author SHA1 Message Date
Allan Jardine
bd804fdcb8 New: child row API methods for showing / hiding child rows
- Showing and hiding details about a row in a child row is very useful
  and proven to be a popular part of DataTables. This commit provides
  that ability in the new API and extends it. It also fully modularises
  the child rows aspects, so it could be removed from the core without
  effecting any other aspects (it may be moved into a seperate file in
  future).

- This will effectively replace fnOpen, fnClose and fnIsOpen

- Added methods:
  - row( selector, opts ).child()
  - row( selector, opts ).child( str, class )
  - row( selector, opts ).child( str, class ).show()
  - row( selector, opts ).child( str, class ).hide()
  - row( selector, opts ).child.show()
  - row( selector, opts ).child.hide()
  - row( selector, opts ).child.isShown()

- Note that unlike the old API you need to specify the data first, and
  then use the show() method to show the child row. This allows the
  details rows to be configured before they are actually shown.

- Additionally multiple child rows can be attached to a parent (pass
  `str` (from above) as an array to use this feature. API plug-ins could
  use this ability to show fully nested tables.

- Not just a string can be passed in now, but also a TR node which will
  actually be used (rather than put into a nested row), any other type
  of node (which will be inserted into a wrapper row/cell) or a jQuery
  object.
2013-05-07 17:56:07 +01:00
Allan Jardine
638a1f6225 Fix #186 - Examples - fix typo 2013-04-23 17:15:29 +01:00
Allan Jardine
c53806feee Fix #184 - examples - typo in y scrolling example 2013-04-23 06:56:58 +01:00
Allan Jardine
b3509a84e8 Fix #183 - examples - typo in sDom example 2013-04-23 06:55:49 +01:00
Allan Jardine
6a5415fe34 Fix #182 - examples - typo in multiple tables example 2013-04-23 06:54:22 +01:00
Allan Jardine
a0ee82fe4b New: Foundation styling example.
- Likely this willl be moved into a 'themes' directroy along with jQuery
  UI and Bootstrap in future, but stashing it here for now.
2013-03-27 09:28:49 +00:00
Allan Jardine
e00037a1af Fix #161: DOM sorting plug-ins updated
- Cope with the change in jQuery 1.9 for element ordering. From the
  DataTables thread on this topic ( 14316 ):

So a bit of further investigation into this - I've used these two test
caseS:

No DataTables: http://live.datatables.net/uwidel/edit#source
DataTables: http://live.datatables.net/ivojev/4/edit

The new DataTables version shows that jQuery 1.9 is now always trying to
order the nodes by document order, not but the order that they are found
in the source array. Additionally removed nodes are appended to the
results, themselves in reserve order, but that's just the way the Sizzle
node ordering works when items are not in the document (try sorting
numbers and you get the same result).

Given the suggestion in the release notes that the move is to have nodes
always treated in document order, I don't think this is a bug, so not
filing one. It is a bit frustrating that the nodes are iterated in a
different order from the source array, but it is expected from their
documentation and comments. So this is simply something we'll need to
work around.

To that end, I've updated the examples and taken the unusual step of
updating the examples on this site outside the normal release cycle. The
examples in the 1.9.4 current release of DataTables can't change of
course, but the updated examples will be in 1.10 when it is released.
2013-02-28 18:55:31 +00:00
Allan Jardine
83b9624273 Examples: Updating examples for the new ajax property
- Note that this update is not complete, just the initialisation is
  done. The examples will shortly be rewritten to be more modular when
  this will be completed (i.e. the code shown on the page will be
  updated)
2013-02-10 12:26:42 +00:00
Allan Jardine
00e6651c4e Dev: Remove debug from example 2013-02-04 19:57:00 +00:00
Allan Jardine
2645463304 Example: Removed localStorage example
- DataTables now uses localStorage by default
2013-02-04 19:48:39 +00:00
Allan Jardine
8dcd96f300 Update - Examples: Column filtering now uses placeholder attribute
- Rather than using Javascript to show a placeholder, use the HTML5
  `placeholder` attribute. That is what it is there for and is supported
  by all current shipping browsers (IE9- do not support it, but will not
  break)
2013-02-02 15:46:38 +00:00
Allan Jardine
6d140835a9 Update: Examples syntax highlighter needs to use on rather than live 2013-02-01 10:03:26 +00:00
Allan Jardine
076744a84c Merge branch 'master' of github.com:DataTables/DataTables 2012-12-21 09:36:10 +00:00
Allan Jardine
86cc702539 Fix:Server-side scripts security flaw - The example server-side scripts
had an injection vunrebility where paging and sorting could be exploited
- 13314. DataTables 1.9.4 has been reissued with these fixes.
2012-12-21 09:33:41 +00:00
Ciro Duran Santilli
f78ce70580 Update examples/api/multi_filter.html
minor improvement: calculate index based on the element's parent th.

this is better because it allows to have some columns that are not searchable (like when the first row is a checkbox row)
2012-11-06 09:08:09 -02: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
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
Allan Jardine
f6401f062a Update: Examples - remove all reference of fnRender, instead granting preference to mRender. 2012-09-09 12:05:37 +01:00
Allan Jardine
93b0c9ede7 Examples: update - bind the 'xhr' event to the table without calling DataTables - no need for that call to be made. 2012-09-02 09:48:45 +01:00
Allan Jardine
660e8cb374 Update - examples: Witht he change in name from mDataProp to mData, this change is now refelected in the examples to encorage mData usage (do remember that mDataProp will still work, but use of mData is encoraged). 2012-08-08 22:30:26 +01:00
Allan Jardine
9c51aa0ad7 New: xhr event 2012-08-08 16:27:42 +01:00
John Kristensen
3be6982a63 Fix typos in examples/api/multi_filter_select.html 2012-07-05 15:31:18 +10:00
Allan Jardine
dc3f9b148e Fix - examples: Security updates to the server-side processing demo scripts from Chris Wright - specifically no MySQL error strings are shown to the end user. 2012-06-12 10:44:10 +01:00
Allan Jardine
90edd0bd94 Example - update: Use $ and fnUpdate in the index column example - 9840 2012-05-10 18:52:25 +01:00
Allan Jardine
09a9755540 Fix - examples: The global filter in the example PHP scripts wasn't taking into account the bSearchable_{i} flag - it was only being checked on individual column filtering - 8949 2012-04-20 08:14:48 +01:00
Allan Jardine
1fa1ef94a8 Update - examples: Update XRegExp to 1.5.1 with IE8 fix 2012-04-16 18:42:21 +01:00
Allan Jardine
43f7878fab Fix - examples: Remove debug code 2012-04-16 18:42:01 +01:00
Allan Jardine
dc59830454 Update: Update the text for the two jEditable examples 2012-04-13 15:20:09 +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
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
d7912b09a0 Examples - fix: Single row selection could have a JS error if deleting a row when no rows selected 2012-03-11 17:56:55 +00:00
Allan Jardine
c09b0b89ea Examples update: Update the JSONP and pipelining examples to store the returned jqXHR object int he settings object. Helpful for the debugger so we can see what the sever says 2012-03-08 19:00:22 +00:00
Allan Jardine
b6709c017b Examples: When the node to show the XHR return is not available, don't try to use it 2012-03-03 13:49:13 +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
aa0ff53ee5 Examples: Update demo SSP PHP code 2012-02-24 06:55:44 +00:00
Allan Jardine
273aab7e59 Examples: Update - Scrolling paging plug-in now uses A tags (based on the updated two button paging for 1.9), has full accessaibility and jQuery UI support 2012-02-16 13:26:09 +00:00
Allan Jardine
d3c2fd551b Fix - examples: Remove link to custom column ordering - now recommended mDataProp 2012-02-10 07:38:45 +00:00
Allan Jardine
019b235b0e Examples: Fix: SyntaxHighlighter was having problems with copy and paste in webkit browsers - fix pushed to syntax highlighter here: https://github.com/alexgorbatchev/SyntaxHighlighter/pull/86 - this is the commit of that fix to the local copy 2012-01-28 10:08:43 +00:00
Allan Jardine
fbab63b7b5 Removed: Column reordering example using sName - it is much better to use mDataProp for this kind of thing now and column reordering is depricated in the 1.9 release of DataTables, so remove the example showing how it might be done to stop new users using it. 2012-01-21 07:43:47 +00:00
Allan Jardine
ccb99b3305 Add the localstorage example to the links list 2012-01-14 12:02:34 +00:00
Allan Jardine
368585da1e Add localstorage example 2012-01-14 10:09:25 +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
94976c2554 Fix: IE7 issue with xregexp 2012-01-07 16:58:01 +00:00
Allan Jardine
e92739fb1f Fix: jEditable calculated width could cause column to resize - just force width to be 100% of the cell, rather than calculated 2012-01-03 09:07:14 +00:00
Allan Jardine
e8c4436132 Update examples list with new custom events demo link 2011-12-28 11:55:39 +00:00
Allan Jardine
e4af1643a0 New: Events demo 2011-12-28 11:49:21 +00:00
Allan Jardine
11557abf0d Remove debug testing in example 2011-12-28 11:13:59 +00:00
Allan Jardine
cb014e81d7 New: Add unit tests for fnCreatedCell and fnCreatedRow
New: New init option fnCreatedRow - very similar to fnCreatedCell but in this case used for TR elements
Updated: fnCreatedCell now also gets the column index passed in
2011-12-28 11:12:30 +00:00
Allan Jardine
8c9f0b61e8 Updated: Nearly all callbacks now use an array and fire an event using the use DataTables standard method for dealing with callbacks. row, header, footer, init and pre-draw callback have been added to this new method. Only aoStateSave does not use method yet. fnCookieCallback and fnInfoCallback will not use the new methods.
Update: fnRowCallback - no need to return the TR element - it was a fairly pointless thing to do - if you want to replace the element then you need to do it with fnDrawCallback
2011-12-27 13:02:18 +00:00
Allan Jardine
d18b68d067 Tabs and spaced mixed in the custom vars example 2011-12-25 11:52:56 +00:00