2017-07-25 12 views
0

こんにちは私は3カレンダーのウェブパーツをページに挿入し、またCEWPに以下のコードを挿入することで3カ月間のローリングカレンダービューを開発しようとしています。SharePoint 2010ローリング3ヶ月カレンダー

カレンダーは、それぞれ「前の月」と「次の月」のボタンをクリックして、前後に移動する必要があります。

ちょうどロールのために働いているようですが、何かが間違っています。誰かがこれで私を助けることができますか?ここで

< script type = "text/javascript" > 
 
    $(document).ready(function() { 
 
    window.setTimeout(setCal, 1000); 
 

 
    }); 
 

 
var CurrentDate = new Date(); 
 

 

 
function setCal() { 
 
    $("#PrevMonth").click(PrevMonth); 
 
    $("#NextMonth").click(NextMonth); 
 

 
    MoveToDate((CurrentDate.getMonth() + 2).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ3'); 
 
    MoveToDate((CurrentDate.getMonth() + 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ2'); 
 
    MoveToDate((CurrentDate.getMonth()).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ1'); 
 
} 
 

 
function PrevMonth() { 
 
    MoveToDate((CurrentDate.getMonth() - 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ3'); 
 
    MoveToDate((CurrentDate.getMonth() - 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ2'); 
 
    MoveToDate((CurrentDate.getMonth() - 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ1'); 
 
} 
 

 
function NextMonth() { 
 
    MoveToDate((currentMonth + 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ3'); 
 
    MoveToDate((currentMonth + 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ2'); 
 
    MoveToDate((currentMonth + 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ1'); 
 
} 
 

 
< 
 
/script>

答えて

0

あなたは、これは完璧に動作し、非常に検索した後、行きます。

<script type="text/javascript" src="http://sharepoint server/sites/page/Scripts/jquery.SPServices.js"></script> 
    <script src="https://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript"></script> 
    <script type="text/javascript"> 

    function myPrevFunction() { 
     document.getElementById("WPQ3_nav_prev_img").click(); 
     document.getElementById("WPQ4_nav_prev_img").click(); 
     document.getElementById("WPQ5_nav_prev_img").click(); 
     document.getElementById("WPQ6_nav_prev_img").click(); 
     document.getElementById("WPQ7_nav_prev_img").click(); 
     document.getElementById("WPQ8_nav_prev_img").click(); 
    } 

    function myNextFunction() { 
     document.getElementById("WPQ3_nav_next_img").click(); 
     document.getElementById("WPQ4_nav_next_img").click(); 
     document.getElementById("WPQ5_nav_next_img").click(); 
     document.getElementById("WPQ6_nav_next_img").click();  
     document.getElementById("WPQ7_nav_next_img").click(); 
     document.getElementById("WPQ8_nav_next_img").click(); 
    } 



    </script> 
    <input type="button" id="CFCCalPrev" value="Prev" onclick="myPrevFunction()"> 
    <input type="button" id="CFCCalNext" value="Next" onclick="myNextFunction()"> 
関連する問題