2016-01-02 66 views
0

在日曆中,如果我在ready.js文件的事件部分中硬編碼json數組,則只能獲取事件。如果我使用網址,那麼他們不會顯示。完整日曆和CakePHP 3.x無法在日曆上顯示事件

如果我瀏覽到帶有顯示json數組的事件的url。

這裏是陣列中的一個示例事件:

[{"id":10,"title":"Utah REIA Monthly Meeting--Your Investor Toolbox provided with the New Website Launch","start":"2015-11-24T18:30:00-0700","end":"2015-11-24T20:30:00-0700","allDay":false,"url":"\/events\/view\/10","details":"\u003Cp\u003E\u003Cspan\u003EAre you a real estate investor who is looking for\u003C\/span\u003E\u003C\/p\u003E\n\u003Col\u003E\n\t\u003Cli\u003EMore education\u003C\/li\u003E\n\t\u003Cli\u003EIndividuals to connect and network with\u003C\/li\u003E\n\t\u003Cli\u003EDiscounts and special offers from retailers you frequent most\u003C\/li\u003E\n\u003C\/ol\u003E\n\n\u003Cp\u003E\u003Cspan\u003EThe Utah REIA has listened and has created a custom website to meet the needs of the real estate investor. This new website will:\u003C\/span\u003E\u003C\/p\u003E\n\u003Col\u003E\n\t\u003Cli\u003EShowcase discounts and special offers from favorite retailers including, but not limited to, Home Depot, Office Max, and Western Reporting.\u003C\/li\u003E\n\t\u003Cli\u003EProvide access to meeting videos and Powerpoint presentations dating back to the inception of the Utah REIA\u003C\/li\u003E\n\t\u003Cli\u003EAllow for Vendors to customize Business Directory listings as well as provide access to post special discounts and incentives\u003C\/li\u003E\n\t\u003Cli\u003EContinue to provide access\u003Cspan class=\u0022text_exposed_show\u0022\u003E to the Utah REIA Library--an archive of 27 folders filled with publications surrounding topics including, but are not limited to 1031 Exchanges, Foreclosures, Forms & Contracts, and Business Management.\u003C\/li\u003E\n\t\u003Cli\u003EProvide a way to connect easily with members of the Utah REIA\u003C\/li\u003E\n\u003C\/ol\u003E\n\n\u003Cp\u003ECome and learn how all of this works so that you can take advantage of these amazing tools as well as provide us with feedback to help us help meet your needs better!\u003C\/p\u003E","className":"Blue"}] 

如果我複製陣列,並將其放置在我的JS文件,它會顯示該事件,但如果我使用的網址。

Ready.js:

jQuery(document).ready(function($) { 

    // page is now ready, initialize the calendar... 
    $('#calendar').fullCalendar({ 

     header: { 
      left: 'title', 
      center: '', 
      right: 'today agendaDay,agendaWeek,month prev,next' 
     }, 
     defaultView: 'month', 
     fixedWeekCount: false, 
     scrollTime: "08:00:00", 
     aspectRatio: 2, 
     editable: adminEdit, 
     events: plgFcRoot + 'events/feed', 
     eventRender: function(event, element) { 
      element.qtip({ 
       content: event.details, 
       position: { 
        target: 'mouse', 
        adjust: { 
         x: 10, 
         y: -5 
        } 
       }, 
       style: { 
        name: 'light', 
        tip: 'leftTop' 
       } 
      }); 
     } 
    }) 
}); 
+0

我完全沒有使用完整日曆的經驗,所以這裏只是一個提示,可能讓你開始:檢查你的瀏覽器網絡和日誌控制檯,並尋找可能的錯誤。另外,對於將來的問題,嘗試選擇更合適的標籤(幾個小時後不再獲得足夠的關注),使用3個CakePHP版本標籤沒有幫助,您最好只選擇一個相關版本,並使用其他標籤進一步指定使用技術,這樣更有可能從知道您正在使用的軟件的人那裏獲得幫助。 – ndm

+0

@ndm謝謝你的提示。我已經檢查了日誌文件夾下的控制檯,網絡和文件,並沒有相關的錯誤或警告。 – Battousai

回答

0

我使用了$這 - > loadComponent( 'RequestHandler');在我的應用程序控制器,這是爲整個應用程序啓用數據視圖,並導致事件不呈現。我把它從我的應用程序控制器中拿出來,它現在正在顯示事件。