我们可以在fullcalendar中使用div而不是table吗?

时间:2013-02-28 09:24:01

标签: jquery fullcalendar

我需要创建一个日历,其中列按照从上到下排列。所以我用div更改了表格。 calander工作得很好。但是事件没有很好地显示出来。事件安排在顶角[一天]。我需要正确地显示每天的事件。并且需要创建新事件。 你能救我吗?

function buildSkeleton(maxRowCnt, showNumbers) {
    var s;
    var headerClass = tm + "-widget-header";
    var contentClass = tm + "-widget-content";
    var i, j,k;
    var table;
    console.log("maxRowCnt:",maxRowCnt);
    console.log("rowCnt:",rowCnt);
    console.log("colCnt:",colCnt);
    s =
        "<div class='main1' id='body' style='width:100%' >";

    for (i=0; i<rowCnt; i++) {//1
        k=100/rowCnt;
        s +=
            "<div class='fc-week" + i + " weeks' style='width:"+ k +"% ;float:left;'>" ;
        for (j=0; j<colCnt; j++) {//7
            s +=
                "<div class='fc-" + contentClass + " fc-day" + (i*colCnt+j) + " weekday'>" + // need fc- for setDayID
                "<span  class='fc- " + headerClass + "'/>"+
                "<div>" +
                (showNumbers ?
                    "<div class='fc-day-number'/>" :
                    ''
                    ) +
                "<div class='fc-day-content'>" +
                "<div style='position:relative'>&nbsp;</div>" +
                "</div>" +
                "</div>" +
                "</div>" ;
        }
        s +=
            "</div >" ;
    }
    s +=
        "</div>";
    table = $(s).appendTo(element);
    console.log("table:",table);
    body = table.find('.main1');
    console.log("body:",body);
    bodyRows = table.find('.weeks');
    console.log("bodyRows:",bodyRows);

    bodyCells = table.find('.weekday');
    console.log("bodyCells:",bodyCells);
    headCells = bodyCells.find('span');
    console.log("headCells:",headCells);
    bodyFirstCells = bodyCells.filter(':first-child');//bodyCells.filter(':first-child');
    console.log("bodyFirstCells:",bodyFirstCells);
    bodyCellTopInners = bodyRows.find('div .fc-day-content div');
    console.log("bodyCellTopInners:",bodyCellTopInners);
    markFirstLast(bodyRows); // marks first+last td's
    bodyRows.addClass('fc-first'); // fc-last is done in updateCells
    dayBind(bodyCells);

    daySegmentContainer =
        $("<div style='position:absolute;z-index:8;'/>")
            .appendTo(element);
}

0 个答案:

没有答案