dynamically add a tile
Closed this issue · 2 comments
Great tool to create dashboards !
I was wondering if it is possible to dynamically add tiles. I tried with jQuery :
clicker = function () { $("#thegrid").append('<div class="tile" col="3" row="3" height="1" width="1"><span resize="top-right">┐</span></div>'); };
This creates an additional tile but it's not draggable or resizable. Maybe my understanding of webcomponents is too limited to make this work.
Advice is welcome.
Indeed, this is currently not supported. Actually, the only missing thing is adding the drag handlers so you can move and resize the tiles. I need to implement it either using a dedicated method on the component itself like a #addTile(element)
, or using MutationObserver on the sub tree. The last one beeing the proper way. In the meantime, feel free to PR ;)
@vortex314 Delivered in v1.4.0