Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Getting a Dock Manager Reference isn't working.
posted

I am using the Dock Manager for two to three panes.  Works great, but I want to be able to capture events.  I have tried the example under Web Components -> Dock Manager -> Events but the reference for the Dock Manager comes up as either 'null' or 'undefined'.

The HTML includes

<igc-dockmanager #dockManager id="dockManager" ... >

I've tried a number of ways to initialize the dockManager, including the @ViewChild.  Currently, it's just:

public dockManager: IgcDockManagerComponent;

The ngOnInit includes:

this.dockManager = document.getElementById('dockManager') as IgcDockManagerComponent;
this.dockManager.addEventListener('activePaneChanged', (ev: CustomEvent<IgcActivePaneEventArgs>) => this.setPanel(ev));

When running the app, there are no errors until attempting to add the event listener, the dock manager is null.

Any ideas would be helpful.

Thanks in advance,
Ted Herrlich
Parents
No Data
Reply
  • 1560
    Offline posted

    Hello,

    I have been looking into your question and prepared a small sample in order to test the behavior. However, on my side, everything seems to work as expected and the event is fired properly.

    Here could be found my sample for your reference. Please test it on your side and let me know how it behaves. If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me along with steps to reproduce.
    Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior.

    Thank you for your cooperation.

    Looking forward to hearing from you.

    Sincerely,
    Teodosia Hristodorova
    Software Developer

Children
No Data