updated the template to support sort event
added function of changing the collection order