RMS.Manage.Web/bower_components/datatables-plugins/type-detection/index.html

(完整代码) 1KB


<h2>Type detection</h2>

<p>When a DataTable is initialised, each column is scanned automatically for the type of data it contains, which in turn allows DataTables to apply the require type of sorting function. There are three built-in types (string, date and numeric) but this can readily be expanded using the functions below. This can make installed a sorting plug-in much easier since you need not specify the <a href="/usage/columns#sType">sType</a> for the column - it will be picked up automatically.</p>
<ul>
	<li><a href="#how_to">How to use DataTables plug-in type detection functions</a></li>
	<li><a href="#functions">Plug-in type detection functions</a></li>
</ul>


<a name="how_to"></a>
<h3>How to use DataTables plug-in type detection functions</h3>

<p>To use of one of the plug-in type detections functions below, you simply need to include it and its counterpart sorting function, in the Javascript available for your page, after you load the DataTables library, but before you initialise the DataTable. Then all you need to do is initialise the DataTable and the type will be automatically detected. As an example the code below makes use of the <a href="#numeric_comma">numeric comma</a> type detection and sorting functions, saved into two different files for clarity (<a href="/examples/plug-ins/sorting_plugin.html">live example</a>):</p>

<pre class="brush: html">&lt;script type="text/javascript" src="jquery.dataTables.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="dataTables.numericCommaSort.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="dataTables.numericCommaTypeDetect.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
	$(document).ready(function() {
		$('#example').dataTable();
	} );
&lt;/script&gt;
</pre>
				
				
<a name="functions"></a>
<h3>Plug-in type detection functions</h3>

include(`build.1.inc')

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。