2017-01-15 49 views
0

私は、今日、月、年、前、次などのヘッダーコンテンツでfullCalendar.jsを使用しています。カスタム追加ボタンを追加しました。最終的にはこのようになります。「新しいクラスを要求する」と言って追加ボタンの前にヘッダー内の単純なテキストは、:fullCalendar HeaderfullCalendarのヘッダーにプレーンテキストを追加する方法

は今、私のヘッダーはそれのようになります。ここ

my headerは、これまでのコードです:

$('#sfullCalendar').fullCalendar({ 
 
    customButtons: { 
 
     myCustomButton: { 
 
      theme: 'true', 
 
      text: '', 
 
      click: function() { 
 
       alert('clicked the custom button!'); 
 
      } 
 
     } 
 
    }, 
 
     defaultView: 'month', 
 
     header: { 
 
     left: 'today', 
 
     center: 'title', 
 
     right: 'prev,next myCustomButton' 
 
     }, 
 
     });
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script> 
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script> 
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

答えて

1

あなたは試すことができます:それはうまく働いた

+0

$('#calendar').fullCalendar({ customButtons: { myCustomButton: { theme: 'true', text: '', click: function() { alert('clicked the custom button!'); } } }, defaultView: 'month', header: { left: 'today', center: 'title', right: 'prev,next myCustomButton' }, eventAfterAllRender: function(view) { if ($('.label').length == 0) { $('.fc-myCustomButton-button').before('<div class="label">test</div>'); } } }); 

Fiddle

敬具
クシシュトフ、おかげでたくさんのクシシュトフKaźmierczak – ashfaqrafi

+0

クール!私は助けることができてうれしいよ! –

関連する問題