Add datatables-1.9.4 and jquery-1.10.2 libraries
[proteocache.git] / webapp / resources / datatables-1.9.4 / extras / Scroller / media / docs / Scroller.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3         <head>
4                 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
5                 <title>Class: Scroller - documentation</title>
6   
7                 <style type="text/css" media="screen">
8                         @import "media/css/doc.css";
9                         @import "media/css/shCore.css";
10                         @import "media/css/shThemeDataTables.css";
11                 </style>
12         
13                 <script type="text/javascript" src="media/js/shCore.js"></script>
14                 <script type="text/javascript" src="media/js/shBrushJScript.js"></script>
15                 <script type="text/javascript" src="media/js/jquery.js"></script>
16                 <script type="text/javascript" src="media/js/doc.js"></script>
17         </head>
18         <body>
19                 <div class="fw_container">
20                         
21                                 <a name="top"></a>
22                                 <div class="fw_header">
23                                         <h1 class="page-title">Class: Scroller</h1>
24                                         
25                                         <div class="page-info">
26                                                 Scroller v1.1.0 documentation
27                                         </div>
28                                 </div>
29
30                                 
31
32                                 <div class="fw_nav">
33                                         <h2>Navigation</h2>
34                                         <ul>
35                                         <li><a href="#top">Overview</a></li>
36                                         <li><a href="#summary">Summary</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Classes (0)</td><td><a href="#summary_namespaces">Namespaces (3)</a></td></tr><tr><td><a href="#summary_properties">Properties (1)</a></td><td><a href="#summary_properties_static">Static properties (1)</a></td></tr><tr><td><a href="#summary_methods">Methods (4)</a></td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li><li><a href="#details">Details</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td><a href="#summary_properties">Properties (1)</a></td><td><a href="#summary_properties_static">Static properties (1)</a></td></tr><tr><td><a href="#summary_methods">Methods (4)</a></td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li></ul>
37                                         <div style="margin-top: 10px;">
38                                                 <input type="hidden" name="show_private" value="0">
39                                                 <span id="private_label">Hiding</span> private elements 
40                                                         (<a id="private_toggle" href="">toggle</a>)
41                                                 </span>
42                                         </div>
43                                         <div>
44                                                 <input type="hidden" name="show_extended" value="1">
45                                                 <span id="extended_label">Showing</span> extended elements 
46                                                         (<a id="extended_toggle" href="">toggle</a>)
47                                                 </span>
48                                         </div>
49                                 </div>
50
51                                 <div class="fw_content">
52                                         <a name="overview"></a>
53                                         <div class="doc_overview">
54                                                 <div class="nav_blocker"></div>
55                                                 <dl><dt id="Scroller" class="  even"><a name="Scroller"></a><a name="Scroller_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a>new Scroller</a></span><span class="type-sig"><span class="signature">(oDT, <span class="optional">oOpts</span>)</span><span class="type-signature"></span></span></span></dt><dd class="  even"><p>Scroller is a virtual rendering plug-in for DataTables which allows large
56 datasets to be drawn on screen every quickly. What the virtual rendering means
57 is that only the visible portion of the table (and a bit to either side to make
58 the scrolling smooth) is drawn, while the scrolling container gives the 
59 visual impression that the whole table is visible. This is done by making use
60 of the pagination abilities of DataTables and moving the table around in the
61 scrolling container DataTables adds to the page. The scrolling container is
62 forced to the height it would be for the full table display using an extra 
63 element. </p>
64
65 <p>Note that rows in the table MUST all be the same height. Information in a cell
66 which expands on to multiple lines will cause some odd behaviour in the scrolling.</p>
67
68 <p>Scroller is initialised by simply including the letter 'S' in the sDom for the
69 table you want to have this feature enabled on. Note that the 'S' must come
70 AFTER the 't' parameter in sDom.</p>
71
72 <p>Key features include:
73   <ul class="limit_length">
74     <li>Speed! The aim of Scroller for DataTables is to make rendering large data sets fast</li>
75     <li>Full compatibility with deferred rendering in DataTables 1.9 for maximum speed</li>
76     <li>Correct visual scrolling implementation, similar to "infinite scrolling" in DataTable core</li>
77     <li>Integration with state saving in DataTables (scrolling position is saved)</li>
78     <li>Easy to use</li>
79   </ul></p><div class="collapse_details"><h3>Constructor</h3><dl class="details">
80         
81 </dl>
82 <h5>Parameters:</h5>
83
84 <table class="params">
85     <thead>
86         <tr>
87         <th width="20"></th>
88         <th width="12%" class="bottom_border name">Name</th>
89                 <th width="10%" class="bottom_border">Type</th>
90                 <th width="10%" class="bottom_border">Attributes</th>
91                 <th width="10%" class="bottom_border">Default</th>
92                 <th class="last bottom_border">Description</th>
93         </tr>
94         </thead>
95         
96         <tbody>
97         <tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oDT</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">oOpts</td><td class="type type-param">object</td><td class="attributes">Optional</td><td class="default">{}</td><td class="description last"><p>Configuration object for FixedColumns. Options are defined by <a href="Scroller.oDefaults.html">Scroller.oDefaults</a></p></td></tr>
98         </tbody>
99 </table><h5>Example:</h5>
100     <div class="example-code">
101         <pre class="brush: js">         $(document).ready(function() {
102                         $('#example').dataTable( {
103                                 "sScrollY": "200px",
104                                 "sAjaxSource": "media/dataset/large.txt",
105                                 "sDom": "frtiS",
106                                 "bDeferRender": true
107                         } );
108                 } );</pre>
109     </div>
110 </div>
111 </dl><h3 class="subsection-title">Requires</h3>
112 <ul>
113         <li>module:jQuery</li><li>module:DataTables</li>
114 </ul>
115
116                                         </div>
117
118                                         
119                                         <div class="doc_summary">
120                                                 <a name="summary"></a>
121                                                 <h2>Summary</h2>
122
123                                                 <div class="doc_group"><a name="summary_namespaces"></a><h3 class="subsection-title">Namespaces</h3>
124 <dl>
125         <dt class="even"><span class="type-name"><a href="c6053fac6b.html">dom</a></span></dt><dd class="even"><p>DOM elements used by the class instance</p></dd><dt class="odd"><span class="type-name"><a href="Scroller.oDefaults.html">oDefaults</a></span></dt><dd class="odd"><p>Scroller default settings for initialisation</p></dd><dt class="even"><span class="type-name"><a href="baed189d4a.html">s</a></span></dt><dd class="even"><p>Settings object which contains customisable information for the Scroller instance</p></dd>
126 </dl></div><div class="doc_group"><a name="summary_properties"></a><h3 class="subsection-title">Properties - instance</h3>
127
128 <dl>
129     <dt class="  even"><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#CLASS">CLASS</a></span><span class="type-sig"><span class="type-signature"> :String</span></span></dt><dd class="  even"><p>Name of this class</p></dd>
130 </dl></div><div class="doc_group"><a name="summary_properties_static"></a><h3 class="subsection-title">Properties - static</h3>
131
132 <dl>
133     <dt class="  even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#VERSION">VERSION</a></span><span class="type-sig"><span class="type-signature"> :String</span></span></dt><dd class="  even"><p>Scroller version</p></dd>
134 </dl></div><div class="doc_group"><a name="summary_methods"></a><h3 class="subsection-title">Methods - instance</h3>
135
136 <dl>
137     <dt class="  even"><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#fnMeasure">fnMeasure</a></span><span class="type-sig"><span class="signature">(<span class="optional">bRedraw</span>)</span><span class="type-signature"> &rarr; {void}</span></span></dt><dd class="  even"><p>Calculate and store information about how many rows are to be displayed in the scrolling
138 viewport, based on current dimensions in the browser's rendering. This can be particularly
139 useful if the table is initially drawn in a hidden element - for example in a tab.</p></dd><dt class="  odd"><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#fnPixelsToRow">fnPixelsToRow</a></span><span class="type-sig"><span class="signature">(iPixels)</span><span class="type-signature"> &rarr; {int}</span></span></dt><dd class="  odd"><p>Calculate the row number that will be found at the given pixel position (y-scroll)</p></dd><dt class="  even"><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#fnRowToPixels">fnRowToPixels</a></span><span class="type-sig"><span class="signature">(iRow)</span><span class="type-signature"> &rarr; {int}</span></span></dt><dd class="  even"><p>Calculate the pixel position from the top of the scrolling container for a given row</p></dd><dt class="  odd"><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#fnScrollToRow">fnScrollToRow</a></span><span class="type-sig"><span class="signature">(iRow, <span class="optional">bAnimate</span>)</span><span class="type-signature"> &rarr; {void}</span></span></dt><dd class="  odd"><p>Calculate the row number that will be found at the given pixel position (y-scroll)</p></dd>
140 </dl>
141 </div>
142                                         </div>
143                                         
144
145
146                                         
147                                         <div class="doc_details">
148                                                 <a name="details"></a>
149                                                 <h2>Details</h2>
150                                                 <div class="doc_group"><a name="details_properties"></a><h3 class="subsection-title">Properties - instance</h3>
151 <dl>
152     <dt class="  even"><a name="CLASS"></a><a name="CLASS_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#CLASS">CLASS</a></span><span class="type-sig"><span class="type-signature"> :String</span></span></dt><dd class="  even"><p>Name of this class</p><div class="collapse_details"><dl class="details">
153         
154 </dl>
155 </div></dd>
156 </dl></div><div class="doc_group"><a name="details_properties"></a><h3 class="subsection-title">Properties - static</h3>
157 <dl>
158     <dt class="  even"><a name="VERSION"></a><a name="VERSION_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#VERSION">VERSION</a></span><span class="type-sig"><span class="type-signature"> :String</span></span></dt><dd class="  even"><p>Scroller version</p><div class="collapse_details"><dl class="details">
159         
160 </dl>
161 </div></dd>
162 </dl></div><div class="doc_group"><a name="details_methods"></a><h3 class="subsection-title">Methods - instance</h3>
163 <dl>
164     <dt id="Scroller#fnMeasure" class="  even"><a name="fnMeasure"></a><a name="fnMeasure_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a>fnMeasure</a></span><span class="type-sig"><span class="signature">(<span class="optional">bRedraw</span>)</span><span class="type-signature"> &rarr; {void}</span></span></span></dt><dd class="  even"><p>Calculate and store information about how many rows are to be displayed in the scrolling
165 viewport, based on current dimensions in the browser's rendering. This can be particularly
166 useful if the table is initially drawn in a hidden element - for example in a tab.</p><div class="collapse_details"><dl class="details">
167         
168 </dl>
169 <h5>Parameters:</h5>
170
171 <table class="params">
172     <thead>
173         <tr>
174         <th width="20"></th>
175         <th width="12%" class="bottom_border name">Name</th>
176                 <th width="10%" class="bottom_border">Type</th>
177                 <th width="10%" class="bottom_border">Attributes</th>
178                 <th width="10%" class="bottom_border">Default</th>
179                 <th class="last bottom_border">Description</th>
180         </tr>
181         </thead>
182         
183         <tbody>
184         <tr class="even"><td class="number right_border"><div>1</div></td><td class="name">bRedraw</td><td class="type type-param">bool</td><td class="attributes">Optional</td><td class="default">true</td><td class="description last"><p>Redraw the table automatically after the recalculation, with
185    the new dimentions forming the basis for the draw.</p></td></tr>
186         </tbody>
187 </table><h5>Example:</h5>
188     <div class="example-code">
189         <pre class="brush: js">   $(document).ready(function() {
190      // Make the example container hidden to throw off the browser's sizing
191      document.getElementById('container').style.display = "none";
192      var oTable = $('#example').dataTable( {
193        "sScrollY": "200px",
194        "sAjaxSource": "media/dataset/large.txt",
195        "sDom": "frtiS",
196        "bDeferRender": true,
197        "fnInitComplete": function (o) {
198          // Immediately scroll to row 1000
199          o.oScroller.fnScrollToRow( 1000 );
200        }
201      } );
202      
203      setTimeout( function () {
204        // Make the example container visible and recalculate the scroller sizes
205        document.getElementById('container').style.display = "block";
206        oTable.fnSettings().oScroller.fnMeasure();
207      }, 3000 );</pre>
208     </div>
209 </div>
210 <dt id="Scroller#fnPixelsToRow" class="  odd"><a name="fnPixelsToRow"></a><a name="fnPixelsToRow_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a>fnPixelsToRow</a></span><span class="type-sig"><span class="signature">(iPixels)</span><span class="type-signature"> &rarr; {int}</span></span></span></dt><dd class="  odd"><p>Calculate the row number that will be found at the given pixel position (y-scroll)</p><div class="collapse_details"><dl class="details">
211         
212 </dl>
213 <h5>Parameters:</h5>
214
215 <table class="params">
216     <thead>
217         <tr>
218         <th width="20"></th>
219         <th width="12%" class="bottom_border name">Name</th>
220                 <th width="10%" class="bottom_border">Type</th>
221                 <th width="10%" class="bottom_border">Attributes</th>
222                 <th width="10%" class="bottom_border">Default</th>
223                 <th class="last bottom_border">Description</th>
224         </tr>
225         </thead>
226         
227         <tbody>
228         <tr class="even"><td class="number right_border"><div>1</div></td><td class="name">iPixels</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Offset from top to caluclate the row number of</p></td></tr>
229         </tbody>
230 </table><h5>Returns:</h5><p class="returns"><p>Row index</p></p><h5>Example:</h5>
231     <div class="example-code">
232         <pre class="brush: js">   $(document).ready(function() {
233      $('#example').dataTable( {
234        "sScrollY": "200px",
235        "sAjaxSource": "media/dataset/large.txt",
236        "sDom": "frtiS",
237        "bDeferRender": true,
238        "fnInitComplete": function (o) {
239          // Find what row number is at 500px
240          alert( o.oScroller.fnPixelsToRow( 500 ) );
241        }
242      } );
243    } );</pre>
244     </div>
245 </div>
246 <dt id="Scroller#fnRowToPixels" class="  even"><a name="fnRowToPixels"></a><a name="fnRowToPixels_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a>fnRowToPixels</a></span><span class="type-sig"><span class="signature">(iRow)</span><span class="type-signature"> &rarr; {int}</span></span></span></dt><dd class="  even"><p>Calculate the pixel position from the top of the scrolling container for a given row</p><div class="collapse_details"><dl class="details">
247         
248 </dl>
249 <h5>Parameters:</h5>
250
251 <table class="params">
252     <thead>
253         <tr>
254         <th width="20"></th>
255         <th width="12%" class="bottom_border name">Name</th>
256                 <th width="10%" class="bottom_border">Type</th>
257                 <th width="10%" class="bottom_border">Attributes</th>
258                 <th width="10%" class="bottom_border">Default</th>
259                 <th class="last bottom_border">Description</th>
260         </tr>
261         </thead>
262         
263         <tbody>
264         <tr class="even"><td class="number right_border"><div>1</div></td><td class="name">iRow</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Row number to calculate the position of</p></td></tr>
265         </tbody>
266 </table><h5>Returns:</h5><p class="returns"><p>Pixels</p></p><h5>Example:</h5>
267     <div class="example-code">
268         <pre class="brush: js">   $(document).ready(function() {
269      $('#example').dataTable( {
270        "sScrollY": "200px",
271        "sAjaxSource": "media/dataset/large.txt",
272        "sDom": "frtiS",
273        "bDeferRender": true,
274        "fnInitComplete": function (o) {
275          // Find where row 25 is
276          alert( o.oScroller.fnRowToPixels( 25 ) );
277        }
278      } );
279    } );</pre>
280     </div>
281 </div>
282 <dt id="Scroller#fnScrollToRow" class="  odd"><a name="fnScrollToRow"></a><a name="fnScrollToRow_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a>fnScrollToRow</a></span><span class="type-sig"><span class="signature">(iRow, <span class="optional">bAnimate</span>)</span><span class="type-signature"> &rarr; {void}</span></span></span></dt><dd class="  odd"><p>Calculate the row number that will be found at the given pixel position (y-scroll)</p><div class="collapse_details"><dl class="details">
283         
284 </dl>
285 <h5>Parameters:</h5>
286
287 <table class="params">
288     <thead>
289         <tr>
290         <th width="20"></th>
291         <th width="12%" class="bottom_border name">Name</th>
292                 <th width="10%" class="bottom_border">Type</th>
293                 <th width="10%" class="bottom_border">Attributes</th>
294                 <th width="10%" class="bottom_border">Default</th>
295                 <th class="last bottom_border">Description</th>
296         </tr>
297         </thead>
298         
299         <tbody>
300         <tr class="even"><td class="number right_border"><div>1</div></td><td class="name">iRow</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Row index to scroll to</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">bAnimate</td><td class="type type-param">bool</td><td class="attributes">Optional</td><td class="default">true</td><td class="description last"><p>Animate the transision or not</p></td></tr>
301         </tbody>
302 </table><h5>Example:</h5>
303     <div class="example-code">
304         <pre class="brush: js">   $(document).ready(function() {
305      $('#example').dataTable( {
306        "sScrollY": "200px",
307        "sAjaxSource": "media/dataset/large.txt",
308        "sDom": "frtiS",
309        "bDeferRender": true,
310        "fnInitComplete": function (o) {
311          // Immediately scroll to row 1000
312          o.oScroller.fnScrollToRow( 1000 );
313        }
314      } );
315      
316      // Sometime later on use the following to scroll to row 500...
317          var oSettings = $('#example').dataTable().fnSettings();
318      oSettings.oScroller.fnScrollToRow( 500 );
319    } );</pre>
320     </div>
321 </div>
322
323 </dd>
324 </div>
325                                         </div>
326                                 
327                 </div>
328
329                 <div class="fw_footer">
330                         Scroller: Copyright 2011-2012 Allan Jardine, all rights reserved<br>
331
332                         Documentation generated by <a href="https://github.com/micmath/JSDoc">JSDoc 3</a> on
333                         23th Sep 2012 - 14:28
334                         with the <a href="http://datatables.net/">DataTables</a> template.
335                 </div>
336         </body>
337 </html>