Forum Discussion
That is interesting Doug. Is that function supposed to also work with a modal component? I'm trying to call such a component this way, essentially with this:
$(".item a").click(function(e) {
var mydata = "Some data to pass"; var ajaxOptions = {success:console.log('SUCCESS!') }; LITHIUM.Components.render("MyModalComponent", {data:mydata}, ajaxOptions);
});
When I do I can see the success message in the console when tells me it should work, but the modal window does not open. The modal component does execute properly in studio when I preview it so that is not the problem. Any ideas?
You could use that to build a modal widget, but it would be up to you to supply the modal library to feed the markup to -- LITHIUM.Components.render will return markup that you can feed to a modal libary. We actually have a special freemarker derictive for loading components in a modal dialog if you are interested in try that out -- see this article for more information about that:
http://community.lithium.com/t5/Developers-Knowledge-Base/Creating-Modal-Dialogs/ta-p/77986
-Doug
- rwm10 years agoAdvisor
Thanks Doug. I have read that page, but given up trying to use the Lithium modal dialog. The limitation I found is with the label parameter, which MUST be the name of a text key in Studio. This would be fine for a simple button or link on a page, but in a dynamically-built video carousel that displays both a thumbnail image and description text for clicking, that won't do. Even when I tested it that way there were other display issues with the dialog box, so it will be easier to use my own modal library.
- DougS10 years agoKhoros Oracle
Well in that case it sounds like LITHIUM.Components.render might be the right choice for you. You will need to feed the response of that call into whatever modal library you choose.