General developer forum

alert instance view link

 
Picture of Ivan Primorac
alert instance view link
 

I am using Moodle 3,4 and developing module for viewing map points in course.

Need help for this one because I am stuck here.

On course-view-topics page I need to alert view module instance to put some custom attributes somewhere.

Purpose is to show point on the map using js with custom point id. I need to push this id somehow to instance view object on course view.

I managed to change default behavior with js:

define(['jquery'], function($) {
    return {
        init: function() {
             $('li.modtype_agis .activityinstance a').click(function(e) {
                e.preventDefault();
                alert("The paragraph was clicked.");   // HERE SHOULD GET FEATURE ID AND RUN JS TO SHOW IT
            });
          }
    };
});

I can get id from module from <a href=..., but I need featureid field from database to show point on the map.

Any suggestions on how to do this please

 
Average of ratings: -
Picture of Ivan Primorac
Re: alert instance view link
 

Ok...this is for other poor souls searching for same thing smile

You don't have to re-render core functions or add new  course format.

Just alert module function (modulename)__get_coursemodule_info in lib.php in module dir.

Add something like: $info->onclick = "";

 
Average of ratings: -