Cross plugins communication?

Cross plugins communication?

donniedonnie Posts: 6Questions: 0Answers: 0
edited January 2015 in Free community support

Hello,

I'm creating a custom plugin. I would like to save some information from this plugin, and retrieve this information from another plugin.

I tried to do this in my custom plugin:

oDTSettings.oInstance._oPluginColResize = this;

Then in the ColReorder plugin, I'm trying to retrieve this variable:

this.s.dt.oInstance._oPluginColResize // undefined :(

So it seems oDTSettings.oInstance and this.s.dt.oInstance are 2 different objects.

Could anybody please help?

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    edited January 2015

    So it seems oDTSettings.oInstance and this.s.dt.oInstance are 2 different objects.

    Correct - use the settings object itself. It is the only thing that is guaranteed to be unique for a table. The instance is not as you can have multiple jQuery references to it.

    For example, consider: $('#myId') !== $('#myId'). They both point to the same element, but they are not the same instance!

    Allan

  • donniedonnie Posts: 6Questions: 0Answers: 0

    Thank you for your fast answer allan, it's much appreciated!

This discussion has been closed.