0

I use unitsview and weekview in scheduler. I need to pass unitID(key) and date to another function, when I click header of classname: dhx_scale_bar. I tried this code: CODE: SELECT ALL

function showTitle(a) {
    alert(a);
    debugger;
    var mode = scheduler.getState().mode;
    var myDate = scheduler.getState().date;
    alert(myDate);


    });
    if (mode == "units")
    {
        var hh= scheduler.getState().date;
        alert(hh);
        alert(mode);

    }
    else if (mode == "week" || mode=="decade") {

        var a = document.getElementById('resourcename');
        var cid = a.options[a.selectedIndex].value;
//here I get the unitId as i use list to filter_week.
        var n = scheduler.getState().date;
        alert(n);
// I get the same date(today's date) whenever i tried to click on any column in weekview or decade view
    }   
}

I attached showTitle(a) function in the main dhtlmxscheduler.js as I don't find any documentation to attach events on header. Please help.

gs11111
  • 649
  • 2
  • 17
  • 49

1 Answers1

0

You can use getActionData API

var unit = scheduler.getActionData(e).section;

where e - native html click event object

Aquatic
  • 5,084
  • 3
  • 24
  • 28