Reputation: 146300
I have this fiddle here: http://jsfiddle.net/maniator/MUa7P/
In this example a user picks a certain number of clients for an account and is able to remove the clients and add clients.
Each account can have at a max 3 clients.
How do i make it so that on either side the clients are in order of client ID always?
Thanks
Upvotes: 0
Views: 72
Reputation: 4002
Solution that goes over the DOM to sort, this relies on everything being ordered on load.
http://jsfiddle.net/compwhizii/vHQGk/12/
Upvotes: 1
Reputation: 22536
You'll have to check the elements in the box it's adding to for it's position and then use the .insertBefore()
or .insertAfter()
methods
Upvotes: 0