Base solution for your next web application
Open Closed

Action dropdown after upgrade to 6.0.0 (Angular) #5678


User avatar
1
mmukkara created

Hi Guys,

"Action" dropdown in the datatable works fine in users, tenants etc. but when incorporated in our components in the app/main path, the dropdown toggle doesn't work. I had to add this below code for the similar situation before v6.0.0 to main-routing.modules.ts to make it work.

constructor(private router: Router) {
        router.events.subscribe(() => {
            this.hideOpenDataTableDropdownMenus();
        });
    }
    hideOpenDataTableDropdownMenus(): void {
        let $dropdownMenus = $('.dropdown-menu.tether-element');
        $dropdownMenus.css({
            'display': 'none'

Now, after upgrade to 6.0.0 and $ clean up. seems like we cannot have this above code and removed it and added (which is in admin-routing.module.ts) below code.

    constructor(
        private router: Router
    ) {
        router.events.subscribe((event) => {
            if (event instanceof NavigationEnd) {
                window.scroll(0, 0);
            }
        });

Nothing seems to work. Please need some help as soon as possible.

fyi, I did copy the same "Action" code what was in users datatable. added all the references BsDropdownModule in main.module.ts.

What else is missing? Appreciate your click reply.

Thanks


3 Answer(s)
  • User Avatar
    0
    mmukkara created

    adding BsDropdownModule from 'ngx-bootstrap' to the module fixed the issue.

  • User Avatar
    0
    tugrulkarakaya created

    could you please give me more detail. I have added but still not working.

  • User Avatar
    1
    mmukkara created

    @tugrulkarakaya, where did you add these below lines?

    I have added to the .module.ts file below lines... Import { BsDropdownModule } from 'ngx-bootstrap'; and in @NgModule({ imports: [ BsDropdownModule.forRoot()