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

How to get an instance reference of the created component by selector

Open
Balaji asked on June 13, 2022

Hi Team, 
 
Good Morning,
I have tried getting an instance reference of your demo sample(https://www.flexmonster.com/demos/js/pivot-table/) by referring $.flexmonster(). But I'm getting 'undefined' value.

Code: 
container id = 'pivot-container'

Inspect element:
$("#pivot-container").data("flexmonster");
undefined
 
Please give me an assistance regarding the above issue.
 
Regards,
Balaji

3 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 14, 2022

Hello, Balaji!
 
Thank you for your question.
 
Kindly note that the $.flexmonster() method has been deprecated since version 2.4. We recommend using the following approach instead:

const flexmonsterAPI = $("#pivot-container")[0].uielement.flexmonster;

Here is the modified demo sample for visualization: https://jsfiddle.net/flexmonster/bn62wfpv/. Please, check out the console to see the resulting Flexmonster object.
 
To read more information about this approach, please look through our docs: https://www.flexmonster.com/api/new-flexmonster/.
 
We hope it helps. Looking forward to your response.
 
Best regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 21, 2022

Hello, Balaji!

Hope you are doing well.

Our team is wondering if you had a chance to try the suggested approach and get the Flexmonster instance from the container. Could you please let us know if it works for you?

Looking forward to hearing from you.

Regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 28, 2022

Hello, Balaji!

Hope you are having a great week.

Just checking in to ask if the suggested approach works for your case.

Looking forward to your response.

Regards,
Solomiia

Please login or Register to Submit Answer