Sorting IP Address
Sorting IP Address
Hi,
We would like to use DataTables to sort on IP address, I was wondering if this is supported? or if not if there is away that I can sort on a hidden column. For example, I have a column called IP but that is sorting using a hidden column called IPAddressNum.
Many Thanks
Chris.
We would like to use DataTables to sort on IP address, I was wondering if this is supported? or if not if there is away that I can sort on a hidden column. For example, I have a column called IP but that is sorting using a hidden column called IPAddressNum.
Many Thanks
Chris.
This discussion has been closed.
Replies
Thanks again
Chris.
On all accounts - yes it is possible :-)
1. Sorting by IP address - you have two options here:
1.1. You can either create a custom plug-in for sorting IP addresses (don't have any at the moment, but if you do decide to create one, let me know and I'll put it up on the plug-ins page) - see for example http://datatables.net/examples/example_sorting_plugin.html .
1.2. You can do as you say and have a hidden column which you use for sorting the data on the visible column. For this you want the iDataSort parameter: http://datatables.net/usage#iDataSort
2. Check boxes: Yes you can put check boxes in each row (perhaps fnRender would be the best way of doing this if you don't want them in the raw html), and then perform actions on the ones which have been selected through the API - for more on the API see http://datatables.net/api and also http://datatables.net/plug-ins for some custom API functions which have been created for DataTables.
Hope this helps,
Allan