We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

dipose() API

Answered
Sumukh asked on December 10, 2023

We are facing an issue while calling dispose method to remove the flexmonster object it throws the below error - 
Uncaught TypeError: Cannot read properties of null (reading 'dispose')
at k.dispose (<anonymous>:2715:155)
at l.dispose (<anonymous>:2731:291)
at loadDashboardForNewData (<anonymous>:74:40)
at Object.success (module-alco.js:123:19)
at u (<anonymous>:2:27457)
at Object.fireWith [as resolveWith] (<anonymous>:2:28202)
at k (<anonymous>:2:77651)
at XMLHttpRequest.<anonymous> (<anonymous>:2:79907)
 
Thanks

Attachments:
flexmonster.png

2 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster December 12, 2023

Hello, Sumukh!

Thank you for writing to us.

We could reproduce a similar error message by calling the dispose API call on an already disposed component. Also, note that Flexmonster automatically calls the dispose method in scenarios when the pivot table instance should be deleted. With this in mind, we suppose that this error was caused by accidentally disposing of the already disposed Flexmonster component. 

Our recommendation is to check if the Flexmonster instance exists before calling the dispose API call. You are welcome to check the example: https://jsfiddle.net/flexmonster/c7phqnd8/ 

Please let us know if our suggestion helped you.

Best Regards,
Maksym

Public
Maksym Diachenko Maksym Diachenko Flexmonster January 4, 2024

Hello, Sumukh!

Hope you are doing well.
We are wondering if you had time to check our previous reply.
Please let us know if the suggested solution helped you.

Best Regards,
Maksym

Please login or Register to Submit Answer