Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

How to get pivot object with jquery

Answered
Mauel Santizo asked on July 20, 2020

Hello, 
I’m working with multiple instances of flexmonster and i want to get the flexmonster object by id using jquery in previous versions the code below works, but with flexmonster v2.8.1 i get undefined.

var pivotObject = $("#pivot-container").data("flexmonster");

1 answer

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster July 22, 2020

Hi Mauel,
 
Thank you for posting your question.
 
We’ve managed to reproduce the described behavior when configuring one Flexmonster instance with vanilla JavaScript and the other one – with jQuery.
 
In case the scenario above resembles your use case, we would recommend configuring all instances through jQuery instead in order to ensure everything works as expected. Furthermore, we’ve checked this on previous Flexmonster versions and it seems to us that such behavior has always been there.
 
Check out a quick sample we’ve prepared where both instances are set up through jQuery and the  
 

$("#pivot-container").data("flexmonster");

 
API call works properly: http://jsfiddle.net/flexmonster/a3yc7vhu
 
Please let us know if this helps.
 
Regards,
Mykhailo

Please login or Register to Submit Answer