M
M
mak_arti2021-02-17 18:41:49
JavaScript
mak_arti, 2021-02-17 18:41:49

How to make dom element events in template active?

Good afternoon. Created a label with a template

var infoContentLayout = ymaps.templateLayoutFactory.createClass('<div class="content" id="contentgrid" onclick="showMatrix()">Тыкни сюда!</div>');

var marker = new ymaps.Placemark([data.location.latitude, data.location.longitude],

        {    hintContent: false    },        {

            iconOffset: [30, -200],

            iconLayout: infoContentLayout

});

    mapObj.geoObjects.add(marker);

The label with the template renders, everything is displayed normally, the question is how to make the showMatrix () function active?

Or tell me the right direction, I think you understand what I want

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question