What if I have a table with an edit button on each row. The edit btn opens a modal dialog saved in a separate template.
Each row/record of the table is in a separate template too.
Now, the best thing to avoid repeating (including) the modal on each table record template would be to put it in the parent template, but then Template.instance().$(’#modalId’).modal(‘show’) doesn’t work, because Template.instance().$ search for the ID in the current template (and the modal dialog is included in its parent template). So there are only 2 options:
- To include the modal code in each table record template and then using Template.instance().$
- To use JQuery directly $(’#modalId’).modal(‘show’)
Any other smart idea to avoid using JQuery directly?