I have an item/product listing that are called from db with a unique id…each listing has a report link, which opens in a modal window. How can I pass the parent id to the modal report?
I’m using featherlight for the modal window as shown below
calling from parent
<a href="report.html .outter-ajax-container" data-featherlight="ajax">
<span id="option-ri" class="inner">Report item</span></a>
function Featherlight($content, config) {
if(this instanceof Featherlight) { /* called with new */
this.id = Featherlight.id++;
this.setup($content, config);
this.chainCallbacks(Featherlight._callbackChain);
} else {
var fl = new Featherlight($content, config);
fl.open();
return fl;
}
}
Could I pass a variable into config? Or use this id in featherlight…
$.extend(Featherlight, {
id: 0, /* Used to id single featherlight instances */
autoBind: '[data-featherlight]', /* Will automatically bind elements matching this selector. Clear or set before onReady */
defaults: Featherlight.prototype, /* You can access and override all defaults using $.featherlight.defaults, which is just a synonym for $.featherlight.prototype */
Have looked at some pointers in below…but not sure if i’d have to create a new function to pass the parameter, or if I could use/amend the featherlight config…
perhaps…
<input id="item-id" type="hidden" value="112233">
<script>$("#item-id", window.parent.document).val();</script>
then how would I display this in modal?