reforming view.js on ajax widget