howdylikes

Google Developersってわかりづらいよね

dhtmlxScheduler - 読み取り専用化

読み取り専用にする方法

リファレンス : http://docs.dhtmlx.com/scheduler/readonly.html#readonlymodefortheentirescheduler

JS読み込み : dhtmlxscheduler_readonly.js

スケジューラーを読み取り専用にする : scheduler.config.readonly = true;

入力画面を読み取り専用にする : scheduler.config.readonly_form = true;

入力画面の特定イベントの特定要素の入力を読み取り専用にする : 以下のようにset_valueを上書き。データのdisabledプロパティにtrueが入っていれば読み取り専用になる

scheduler.form_blocks.textarea.set_value=function(node,value,ev){
    node.firstChild.value=value||"";
    node.firstChild.disabled = ev.disabled; //or just '= true' to disable all events
};

scheduler.parse([
    { start_date: "2009-06-30 09:40", end_date: "2009-07-01 12:00", text:"Task A-12458", section_id:1},
    { start_date: "2009-06-30 10:00", end_date: "2009-06-30 21:00", text:"Task A-89411", section_id:1, disabled:true},
    { start_date: "2009-07-01 12:00", end_date: "2009-07-02 18:00", text:"Task D-12458", section_id:4}
],"json");

入力画面の特定イベントを読み取り専用にする : 以下のようにIDを振っておきreadnlyプロパティを変更

 scheduler.parse([
    { id: "11111", start_date: "2009-06-30 09:40", end_date: "2009-07-01 12:00", text:"Task A-12458", section_id:1},
    { id: "22222", start_date: "2009-06-30 10:00", end_date: "2009-06-30 21:00", text:"Task A-89411", section_id:1, disabled:true},
    { id: "33333", start_date: "2009-07-01 12:00", end_date: "2009-07-02 18:00", text:"Task D-12458", section_id:4}
],"json");

scheduler.getEvent("33333").readonly = true;