连夜求助一个关于calendar 的制作逻辑问题

Posted on 2009-03-16 01:44 Robert Su 阅读(936) 评论(0)  编辑  收藏 所属分类: ExtJS

现在遇到的问题是生成折个每周事项的表格是逻辑乱了~
以下是Javascript代码:
顶部周一周二是另一个循环生成的,现在是下面的日期这块出现了问题
我现在想只显示上下午,但是由于事件Item的日期判断这块现在很乱
发到首版来讨论下这个问题


       var _minutesPerStep = 0;
       var _stepsPerHour = 0;
       

        var _tr, _td;
        var _stepCounter = 0;
        var _dayIndex = 0;
        var _hourIndex = 0;
        var _totalSteps = 24 * _stepsPerHour;
        for (var _steps = 0; _steps < _totalSteps; _steps++) {
            if(_steps==12){
            _tr = _table.dom.insertRow(_steps);}
            //timerows
            _dayIndex = 0;
            for (var _days = 0; _days < 8; _days++) {
                if (_days == 0) {
                    if (_stepCounter == 0) {
                        _tr.className = "HourDivider";
                        _td = _tr.insertCell(_dayIndex++);
                        _td.style.width = _firstColWidth + "px";
                        _td.rowSpan = _stepsPerHour;
                        _td.className = "Time";
                        _td.innerHTML = (_hourIndex > 9 ? "" : "0") + (_hourIndex++) + ":00";
                        if (_steps === 0) {
                            _tableContainerCell = Ext.get(_td);
                        }
                    }
                    else {
                    
                        _tr.className = "StepDivider";
                    }
                }
                else {
                    _td = _tr.insertCell(_dayIndex++);
                    _td.className = "TimeStep";
                    _td.day = _days;
                    _td.step = _steps;
                    _td.ddTarget = new Ext.dd.DDTarget(_td, "Calendar");
                }
            }
            _stepCounter = _stepCounter == (_stepsPerHour - 1) ? 0 : _stepCounter + 1;
        }
    }



只有注册用户登录后才能发表评论。


网站导航:
 

posts - 103, comments - 104, trackbacks - 0, articles - 5

Copyright © Robert Su