Still fairly new to WAB, and dojo on the whole, so perhaps this has a simple answer.
Take, for example, the out-of-the-box version 1.2 Search widget. Inside its .js file is the following few lines:
this.own(
on(this.searchDijit, 'select-result', lang.hitch(this, '_onSelectResult'))
);
I'm wondering if there's away to hitch on to this exact same event from another custom non-panel widget. The desired behavior is that whenever the out-of-the-box Search widget's searchDigit fires its 'select-result' event, this other custom widget can perform an action as well, using the same argument object that is passed to the local Search's event handler.
I'm trying to avoid modifying the out-of-the-box Search widget's code, as it seems pretty tightly coupled to the WAB layout. Though if there are any best practices for this latter approach, I'm open to those as well.
Solved! Go to Solution.
Anthony,
Sure you can all you need to do is get a reference to the search widget object using WidgetManager and then you will have access to the this.searchDijit and you can attach as many event listeners as you want to the 'select-result'.
Anthony,
Sure you can all you need to do is get a reference to the search widget object using WidgetManager and then you will have access to the this.searchDijit and you can attach as many event listeners as you want to the 'select-result'.
I had a feeling this'd be the case, thanks. Just wasn't sure if I'd be able to access the .searchDijit that way.
Hi , I'm wondering did you ever find a way to get this searchDijit from WidgetManager instance.I got till the search Widget , but couldnt get to the searchDijit from that. I'm stuck currently.