Fix javascript display order

When you save and redisplay javascript on an element, the javascript actions appear in a different order.

This fix adds an ORDER clause to the query to ensure that the records are received in the same sequence as saved.