How to sort on state
How to sort on state
![fpakay](https://secure.gravatar.com/avatar/c25ca803d0ab336558867a5cc228b1a8/?default=https%3A%2F%2Fvanillicon.com%2Fc25ca803d0ab336558867a5cc228b1a8_200.png&rating=g&size=120)
in DataTables
EG: Charlotte, NC
How can I sort on the state as in the example above.
I would also like to sort on last name. EG: John Doe
Answers
For either one you can create a sorting plugin or you can use Orthogonal data to set the sorting value to the state or lastname.
Kevin
Thanks Kevin.
Looked at the two options above, however I do not understand either. Any one have an example? That would be very much appreciated.
data-order
attributes.Allan
If you post an example of what you've got at the moment we can look at how it might be best modified.
Allan
This is a typical datagrid where I would like to sort on last name.![](https://datatables.net/forums/uploads/editor/ez/xumc331tz04y.png)
Here is an example of sorting by last name:
https://live.datatables.net/yuwosuwu/1/edit
It uses Orthogonal data to manipulate the original data to the data to sort on for the
sort
operation. For example:You can do something similar with the state.
Kevin