2013-10-16 65 views
0

我在調度程序中使用了unitview和weekview。 我需要通過unitID(key)和日期到另一個功能,當我點擊標題classname: dhx_scale_bar。 我試過這段代碼: 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 
    } 
} 

我連着showTitle(a)功能在主dhtlmxscheduler.js因爲我沒有找到任何文件附加在頭事件。請幫忙。

回答

0

您可以使用getActionData API

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

其中e - 本地的HTML click事件對象

+0

我得到錯誤說E沒有被定義 – gs11111

相關問題