Type.registerNamespace("Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate");
Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.Model=function(_1,_2){
this._owner=_1;
this._modelData=Sys.Serialization.JavaScriptSerializer.deserialize(_2);
this._rawModelData=_2;
this._timelineModels=new Array();
this._resources=null;
};
Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.Model.prototype={initialize:function(){
var _3=this._modelData.groupingResource;
this._resources=this._owner.get_resources().getResourcesByType(_3);
for(var i=0;i<this._resources.get_count();i++){
this._timelineModels[i]=new Telerik.Web.UI.Scheduler.Views.Timeline.Model(this._owner,this._rawModelData);
}
},getTimeSlotFromDomElement:function(_5){
var _6=this._getRawIndexFromDomElement(_5);
var _7=this._getTimeFromDomElement(_5);
var _8=this._resources.getResource(_6.modelIndex);
var _9=this._timelineModels[0]._slotDuration;
return new Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.TimeSlot(_6,_7,_9,_8,_5);
},_getRawIndexFromDomElement:function(_a){
while(_a&&(_a.tagName.toUpperCase()!="TD")){
_a=_a.parentNode;
}
if(!_a){
return null;
}
var _b=_a.cellIndex%this._resources.get_count();
var _c={};
_c.modelIndex=_b;
var _d;
if(this._modelData.isVertical){
_d=_a.parentNode.rowIndex;
}else{
_d=Math.floor(_a.cellIndex/this._resources.get_count());
}
_c.intervalIndex=_d;
return _c;
},_getTimeFromDomElement:function(_e){
var _f=this._getRawIndexFromDomElement(_e);
return this._timelineModels[0]._getTimeFromIndex(_f);
}};
Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.Model.registerClass("Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.Model");
Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.TimeSlot=function(_10,_11,_12,_13,_14){
this._resource=_13;
Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.TimeSlot.initializeBase(this,[_10,_11,_12,_14]);
};
Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.TimeSlot.prototype={get_index:function(){
var _15=this.get_rawIndex();
var _16=Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.TimeSlot.callBaseMethod(this,"get_index");
return String.format("{0}:{1}",_15.modelIndex,_16);
},get_resource:function(){
return this._resource;
}};
Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.TimeSlot.registerClass("Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.TimeSlot",Telerik.Web.UI.Scheduler.Views.Timeline.TimeSlot);

