Don't print widget when call it

Hello guys, I’m using the jquery widget, but there’s one thing I wanted to change. Every time I enter a widget of these is printed in the exact spot where the call. I would like to put the contents of a widget into a variable for later use. As a solution, I extended the widget to do this. But I was wondering if there is a way, perhaps using behaviors to achieve this result.


Tried setting $captureOutput to true?

thanks. it’s work perfectly