2016-04-19 17 views
0

私はそれはそれは、今、私はすでに私は保存ボタンを押すと が欲しいグレートどのようにカレンダープラグインでアイテムがドロップされた日付を知ることができますか?

を作品ドラッグ可能とFullcalendarプラグインthisを持っている:カレンダー上にループにし、ドラッグしたアイテムを追跡し、私は要素を検査するとき、それ を扱う私は私はinnerHTMLプロパティを使用することができます参照してください。しかし、私は

as This Picture 私の内部HTMLを

  <div class="fc-content" style="position: relative;"> 
       <div class="fc-view fc-view-month fc-grid" style="position:relative" unselectable="on"> 
        <div class="fc-event-container" style="position:absolute;z-index:8;top:0;left:0"> 
         <div class="fc-event fc-event-hori fc-event-draggable fc-event-start fc-event-end" style="position: absolute; left: 223.6px; width: 106px; top: 136.4px;"> 
          <div class="fc-event-inner"> 
           <span class="fc-event-title">Villagio door 10</span> 
          </div> 
          <div class="ui-resizable-handle ui-resizable-e">&nbsp;&nbsp;&nbsp;</div> 
         </div> 
        </div> 

として表示されます要素の日時を知ることができない、これは私のドラッグ可能なIですTEM

<div class="fc-event-inner"> 
            <span class="fc-event-title">Villagio door 10</span> 
           </div> 

私は今、私はちょうどそれは、「2016年4月5日」として、その日付を取得するために何かをこのアイテムの日付を知っておく必要がありますどのような

$("div.fc-event-inner").each(function() { 
       var rr = $(this).fullCalendar("getDate"); 
       alert("FW: " + rr + ", val: " + $(this).val()); 
      }); 

としてdiv要素の中にループにしてみてください?私はどうなるのか

+0

を落としてきたものを使用します:) – VisualBean

答えて

0

: にフラグを追加 (はい、これは可能です!)あなたがイベントにプロパティを追加することができます。ここ

$('#calendar').fullCalendar({ 
    events: [ 
     // events here 
    ], 
    editable: true, 
    eventDrop: function(event, delta, revertFunc) { 

     alert(event.title + " was dropped on " + event.start.format()); 

     if (!confirm("Are you sure about this change?")) { 
      revertFunc(); 
     } 

    } 
}); 

http://fullcalendar.io/docs/event_ui/eventDrop/

EventDropイベントハンドラを使用してくださいそれがドロップされているかどうかを確認してください。 そして、すべてのイベントをループをthis fiddle

を参照して唯一の私の答えをご覧ください

関連する問題