<?xml version="1.0" encoding="UTF-8" ?>
<dt-example table-type="html-grade" order="3">

<css lib="datatables" />
<js lib="jquery" />
<js lib="datatables" />

<title>Ordering plug-ins (no type detection)</title>
<js><![CDATA[

$.fn.dataTable.ext.type.order['salary-grade-pre'] = function ( d ) {
	switch ( d ) {
		case 'Low':    return 1;
		case 'Medium': return 2;
		case 'High':   return 3;
	}
	return 0;
};

$(document).ready(function() {
	$('#example').DataTable( {
		"columnDefs": [ {
			"type": "salary-grade",
			"targets": -1
		} ]
	} );
} );

]]></js>

<info><![CDATA[

Although DataTables will order a number of data types using the built in methods, when dealing with more complex formatted data, it can be desirable to define the ordering order yourself. Using plug-in ordering functions, you can have DataTables order data in any manner you wish.

This is done by using the `dt-init columns.type` parameter, in combination with a ordering plug-in. The ordering plug-in can be of any level of complexity (natural ordering for example can be fairly complex while also very powerful), and is defined by attaching to the `$.fn.dataTable.ext.type.order` object. For more information about ordering plug-ins, creating them and their requirements, please refer to the plug-in development documentation.

This example shows ordering with using an enumerated type.

A wide variety of ready made ordering plug-ins can be found on [the DataTables plug-ins page](//datatables.net/plug-ins/sorting).

]]></info>

</dt-example>
