3 * Generate the node required for the info display
4 * @param {object} oSettings dataTables settings object
5 * @returns {node} Information element
6 * @memberof DataTable#oApi
8 function _fnFeatureHtmlInfo ( oSettings )
10 var nInfo = document.createElement( 'div' );
11 nInfo.className = oSettings.oClasses.sInfo;
13 /* Actions that are to be taken once only for this feature */
14 if ( !oSettings.aanFeatures.i )
16 /* Add draw callback */
17 oSettings.aoDrawCallback.push( {
19 "sName": "information"
23 nInfo.id = oSettings.sTableId+'_info';
25 oSettings.nTable.setAttribute( 'aria-describedby', oSettings.sTableId+'_info' );
32 * Update the information elements in the display
33 * @param {object} oSettings dataTables settings object
34 * @memberof DataTable#oApi
36 function _fnUpdateInfo ( oSettings )
38 /* Show information about the table */
39 if ( !oSettings.oFeatures.bInfo || oSettings.aanFeatures.i.length === 0 )
45 oLang = oSettings.oLanguage,
46 iStart = oSettings._iDisplayStart+1,
47 iEnd = oSettings.fnDisplayEnd(),
48 iMax = oSettings.fnRecordsTotal(),
49 iTotal = oSettings.fnRecordsDisplay(),
54 /* Empty record set */
55 sOut = oLang.sInfoEmpty;
58 /* Normal record set */
64 /* Record set after filtering */
65 sOut += ' ' + oLang.sInfoFiltered;
69 sOut += oLang.sInfoPostFix;
70 sOut = _fnInfoMacros( oSettings, sOut );
72 if ( oLang.fnInfoCallback !== null )
74 sOut = oLang.fnInfoCallback.call( oSettings.oInstance,
75 oSettings, iStart, iEnd, iMax, iTotal, sOut );
78 var n = oSettings.aanFeatures.i;
79 for ( var i=0, iLen=n.length ; i<iLen ; i++ )
86 function _fnInfoMacros ( oSettings, str )
89 iStart = oSettings._iDisplayStart+1,
90 sStart = oSettings.fnFormatNumber( iStart ),
91 iEnd = oSettings.fnDisplayEnd(),
92 sEnd = oSettings.fnFormatNumber( iEnd ),
93 iTotal = oSettings.fnRecordsDisplay(),
94 sTotal = oSettings.fnFormatNumber( iTotal ),
95 iMax = oSettings.fnRecordsTotal(),
96 sMax = oSettings.fnFormatNumber( iMax );
98 // When infinite scrolling, we are always starting at 1. _iDisplayStart is used only
100 if ( oSettings.oScroll.bInfinite )
102 sStart = oSettings.fnFormatNumber( 1 );
106 replace(/_START_/g, sStart).
107 replace(/_END_/g, sEnd).
108 replace(/_TOTAL_/g, sTotal).
109 replace(/_MAX_/g, sMax);