Closed ZaLiTHkA closed 6 years ago
hmmm... ok, now I'm very confused. I just tried to replicate this behaviour in Codepen and it is actually working with my first example ("data-custom-thing": function() { ... }
). not sure why it wasn't doing this in my own project, but at least now I know this does work with Transparency.
lol. so I just realised what I was doing wrong... basically in my own code I was actually trying to add the custom attribute to the same element I was targeting for the render in the first place.
when I do something like $("#widget").render()
, then add my custom attribute to one of it's children (<section data-bind="widget-container">
) then it all works beautifully. :) it's so simple that I completely overlooked it..
so, I suppose I should say; thanks for such a simple library! 🖖
Greetings.. :)
I'm using Transparency to render frames for widgets before I populate them with data, but due to the dynamic nature of the source data, I need to be able to set custom data for some of them to override the page defaults.
Using the template (examples trimmed for brevity):
First attempt:
Second attempt
Third attempt
I tried a few other embarrassingly silly things that I wouldn't dare repeat here.... But is what I'm trying to do even possible, or should I just look for anther way to handle this?