Custom Sorting Column of Capacities in jQuery Datatables
Custom Sorting Column of Capacities in jQuery Datatables
![Liza](https://secure.gravatar.com/avatar/9be681f14c5a82374160fc3d7c1cfc08/?default=https%3A%2F%2Fvanillicon.com%2F9be681f14c5a82374160fc3d7c1cfc08_200.png&rating=g&size=120)
Hello
I have a datatable with capacities column like this :
<table id="datatable" class="table">
<thead> <tr> <th>capa</th> </tr> </thead>
<tbody>
<tr>
<td>2 Go</td>
</tr>
<tr>
<td>1 To</td>
</tr>
<tr>
<td>320 Go</td>
</tr>
<tr>
<td>2 To</td>
</tr>
<tr>
<td>500 Go</td>
</tr>
</tbody>
</table>
<script>
$(document).ready(function() {
$('#datatable').dataTable({
'aaSorting': [],
'iDisplayLength': 50,
'aLengthMenu': [[10, 25, 50, 100, 500, -1], [10, 25, 50, 100, 500, 'Tous']]
});
});
</script>
and I am trying to sort it to get this result :
2 Go
320 Go
500 Go
1 To
2 To
But can't figure out how to do it from reading the sorting plugins docs.
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The file size plug-in is probably the best starting point. If you struggle with that, post up your code and I'll take a look.
Allan
Thanks very much. it works with file size plug-in