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

Update - init: scrollX can be set as true

- scrollX was often the source of frustration when setting it to
  anything other than "100%", which is was in the demos and
  documentation but it makes it easy to see that you could set it to be
  50% or anything else. That usually broke the developer's layout. So
  now you can just use scrollX: true, to enable horizontal scrolling.
  The demos have been updated for this.
This commit is contained in:
Allan Jardine 2013-10-09 14:56:01 +01:00
parent 888c4374e8
commit 8573d5955c
2 changed files with 13 additions and 8 deletions

View File

@ -1 +1 @@
a4723cd28da1a8133232eb5ce83e19b8ff86a50d
4e31fb7585a9b338257edd8472de37255f924a0d

View File

@ -5693,6 +5693,9 @@
{
oSettings.oScroll.iBarWidth = _fnScrollBarWidth();
}
if ( oSettings.oScroll.sX === true ) { // Easy initialisation of x-scrolling
oSettings.oScroll.sX = '100%';
}
if ( oSettings.iInitDisplayStart === undefined )
{
@ -10926,12 +10929,14 @@
/**
* Enable horizontal scrolling. When a table is too wide to fit into a certain
* layout, or you have a large number of columns in the table, you can enable
* x-scrolling to show the table in a viewport, which can be scrolled. This
* property can be any CSS unit, or a number (in which case it will be treated
* as a pixel measurement).
* @type string
* Enable horizontal scrolling. When a table is too wide to fit into a
* certain layout, or you have a large number of columns in the table, you
* can enable x-scrolling to show the table in a viewport, which can be
* scrolled. This property can be `true` which will allow the table to
* scroll horizontally when needed, or any CSS unit, or a number (in which
* case it will be treated as a pixel measurement). Setting as simply `true`
* is recommended.
* @type boolean|string
* @default <i>blank string - i.e. disabled</i>
*
* @dtopt Features
@ -10940,7 +10945,7 @@
* @example
* $(document).ready( function() {
* $('#example').dataTable( {
* "scrollX": "100%",
* "scrollX": true,
* "scrollCollapse": true
* } );
* } );