Current versions of jQuery UI (I can confirm this with 1.11.x) allow you to query an instance of a widget using the instance() method. It will look like this:
$('#container').investmentGrid('instance')
If the item does not have an investmentGrid widget assigned, you will get undefined back.
Instead, you can use the call:
$(#container').is(':data("namespace-investmentGrid")')
This has the advantage that it also works, even if the widget is not loaded.
Sebastian zartner
source share