I am working on a plugin that manipulates repeating groups; however, when I place the plugin into the first cell, it always calls the update function twice for every cell. I am only logging to the console, yet it will log it twice for each cell, no matter how many cells there are. The console only logs once when I put it in the initialize function, as expected.
Unfortunately, it’s bringing my current project to a halt. The div I create and append gets appended twice for each cell of the repeating group. Darn!
edit: I resolved by setting an instance.data variable to ‘false’ when the update code had yet to run, then updating it to ‘true’ once the code ran once
There might be a more elegant solution, but might it be possible to prevent duplicates with a bit of logic - e.g. checking for the existence of the div before adding it or using the instance.data object to flag whether or not it’s already been added? Just a thought.