Calling widget public method from inside onClick function
In my _create method, I add a click method to a class of elements:
- $(this.options.tabSelector).find('.tabCollapser').on('click', function () {
- var panelId = $(this).closest('.ui-tabs-panel')[0].id;
- $(this).closest('div.ui-tabs').collapsible('hide', panelId);
- });
Within the finction, "this" applies to the element that was clicked on. I can find the div associated with my widget ($(this).closest('div.ui-tabs')), but when this function executes, it reloads the entire page.
I suspect that calling the widget again may be part of the problem: