0

dhtmlxcalendar をテキスト ボックスに初期化しています。カレンダーをクリックした後、日付を選択せず​​に他のタブをクリックすると、カレンダーが閉じません

var myCalendar = new dhtmlXCalendarObject(["effStartDate"]);
     myCalendar.setDateFormat("%d-%M-%Y");
     myCalendar.setSensitiveRange(new Date(),null);
     document.getElementById("effStartDate").value=  currentDate();

そして、1つのクローンがカレンダーである1つのdhtmlxグリッドがあります。閉じていない日付を選択していない場合も同じ問題があります

var responsibilityTaskGrid;
    responsibilityTaskGrid = new dhtmlXGridObject('responsibilityTaskGridBox');
    responsibilityTaskGrid.setImagePath("dhtmlx/dhtmlxGrid/codebase/imgs/");
    responsibilityTaskGrid.setHeader("Responsibility Name,Task UI Name,Effective Start Date,Effective End Date,Status,Edit/Delete,ID");
    responsibilityTaskGrid.setInitWidths("150,*,120,120,80,80,0");
    responsibilityTaskGrid.setColAlign("left,left,center,center,center,center");
    responsibilityTaskGrid.setColTypes("ro,ro,ro,dhxCalendarA,ro,ro,ro");
4

1 に答える 1

0

DHTMLX では、そのオプションは提供されていません。

「ESC」キーを使用するか、以下のコードのようにカレンダー オブジェクトをカスタマイズします。

パス:- dhtmlx/dhtmlxCalendar/codebase/dhtmlxcalendar.js

//Declare public variable here


var calObject;

function dhtmlXCalendarObject(inps, skin) {

......

// create base
this.base = document.createElement("DIV");
// After this Code

....



//Code add for place the image in dhtmlx Calendar
    this.base.innerHTML = "<div class='dhtmlxcalendar_month_cont'><ul class='dhtmlxcalendar_line'>" +       
            "<li class='dhtmlxcalendar_cell dhtmlxcalendar_month_hdr'>" +
            "   <div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right'>" +
            "       <img id='myImg' src='images/icon-close.gif' height='15px' width='15px' onclick='javascript:calClose(this)'/>" +
            "   </div>" +
            "</li>" +           
            "</ul></div>";
//end here

.....



// set init date
this.setDate(this._activeDate);
//After this Code 

.....

**//Code add for assigning object


calObject = this;


}

//Code add for close the calendar
function calClose(elem){    
    calObject.hide();
}

//ここで終了

于 2014-07-15T10:30:30.293 に答える