Sorting IP Address

Sorting IP Address

kippikippi Posts: 3Questions: 0Answers: 0
edited May 2009 in General
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.

Replies

  • kippikippi Posts: 3Questions: 0Answers: 0
    All so is it possible to have a select box by the side of each row so that you can select a row (or all rows) and then carry out an action, eg, delete all etc?

    Thanks again

    Chris.
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Hi 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
This discussion has been closed.