Skip to content

Instantly share code, notes, and snippets.

View MrMartiniMo's full-sized avatar

Moritz Krause MrMartiniMo

View GitHub Profile
@obiPlabon
obiPlabon / vc-parent-child-communication.js
Last active December 12, 2019 11:07
Parent to child and child to parent (bidirectional) communication in Visual Composer shortcode
/**
NOTES:
========================
0. Extend container view from "VcColumnView" so that you get a clean UI.
1. Render method called after element is added (cloned), and on first initalization.
2. Use model.getParam(param_name) to get specific param from params.
3. Use model.get("params") to get complete params object.
4. If params is changed then shortcode will be rendered automatically.
5. You do not need to override method that you are not going change, in our file "render".
**/