You should definitly look into knockout.js @ http://knockoutjs.com/examples/betterList.html
Once you know how it works, you will simple LOVE it.
Edit:
A little more information:
you will work with observableArrays which will trigger knockout to change the HTML for you as soon as you modify (like sort for example) - which is amazing right?
Edit2:
Stack overflow has a lot of support for knockout as well, so questions will most likely get answered!
So knockout works with a viewmodel which is bound to the view.
Inside this viewmodel you would have a partyList (called parties in my example) which is an observableArray.
The viewmodel could be formatted as such:
var viewmodel = function(){
self = this;
self.parties = ko.observableArray([{ name: "Halloween", date: "2014/10/31" },{ name: "Christmas", date: "2014/12/25" }]);
self.sortParties = function(){
self.sortParties().sort(function(a, b){
//here comes the sorting logic you want to apply
}
});
};
ko.applyBindings(new viewmodel());
The HTML could be something like this:
<div data-bind="foreach: parties">
<div data-bind="text: name" />
<div data-bind="text: date" />
</div>
<button data-bind="click: sort">Sort</button>
This HTML would first render the two inner divs for every event in the parties array (so in this case 2) and display the name and the date.
If a user clicks the button, then the sort method would be called. The nice thing about knockout is that whatever order the objects in your array are in, will be exactly represented in your HTML without you having to do anything else then clicking the button. The code I provided is everything you need (including the knockout scripts of course) to get this to work.
You want to add a new party? No problem, add an add method to the viewmodel which would add a party to the parties and it will appear in the HTML.