Is there a widget available or has some one worked on a widget that uses functionality from this JS sample
I think this place is much more better for your question:
Web AppBuilder Custom Widgets
Thanks... just moved the question there.
Retrieving data ...