Closed nadir35 closed 7 years ago
Hi @nadir35 I'm using custom widgets on my project L.I.S.A. with the ability to remove a custom widget but I didn't notice any problem with it. Take a look at it https://github.com/mylisabox/lisa-ui but if you didn't find a solution yes please make a small project, like this I can try and see the problem Thanks
Hi, thanks for the quick response.
I have looked into your project, and adapted the way you handle the onRemoveEvent. However the problem still remains... I have uploaded my project here : https://github.com/nadir35/customwidgetdashboard/tree/master/testa
To reproduce add 2 widgets to the dashboard, then swap their order and then try to delete either. Thanks.
Thanks for the project ! I was able to find where the problem come from... The problem is here https://github.com/jaumard/ngx-dashboard/blob/master/src/components/dashboard/dashboard.component.ts#L210 when you reorder widgets the order of _viewCntRef
is not changed so it remove the wrong one :(
For now I don't know how to fix it, any idea? I'll keep searching
Fixed on v1.1.0 by an ugly fix for now, if I found a better way I'll change that. Also be careful I change the name of the module to NgDashboardModule as I leave angular 2 behind
Thank you.
After creating several custom widgets and trying to close them with dashboard.removeById(), a bug occurs if you shuffle the widgets order. It looks like the wrong widget is getting removed, however upon inspection of the "elements" array of the DashboardComponent I can see that the widget with the correct ID was removed. I also noticed that "disableAnimation" seems to fail in this scenario, the element of the widget I was trying to delete remains with "animate" and pretty much breaks. Is such a problem known to you? Have you tried to do removable custom widgets? Maybe my implementation of that is just wrong. I can upload my project so you can see for yourself if you want.