Make ding.js slightly more dynamic in generating the widget