2013-06-20 3 views
0

켄드 캘린더를 이런 식으로 연장하는 방법은? 나는이 mvc4/면도칼에게검도 캘린더 연장

를 사용하는 경우에만이 내 calendar.cshtml에서

<div class ="kendocalender"> 
    @(Html.Kendo().Calendar() 
    .Name("Calendarname") 
    .HtmlAttributes(new { style = "width: 180px;height:200px;font-size:13px" }) 
) 
</div> 

public ActionResult Calendar() 
{ 
    return View(); 
} 

enter image description here

답변

0

정적 정적 방법을 확인 calendarcontroller 내 컨트롤러 actionresult입니다 클래스 - 확장 메서드

public static MvcHtmlString KendoCalender<TModel>(this HtmlHelper<TModel> htmlHelper, string name, object htmlAttributes) 
{ 
    string calenderControl = htmlHelper.Kendo().Editor() 
        .Name(name) 
        .HtmlAttributes(htmlAttributes) 
        .ToHtmlString(); 

    return MvcHtmlString.Create(calenderControl); 
} 

에는보기에 네임 스페이스가 포함되어 있으며이 코드로보기에서 호출 할 수 있습니다.

@Html.KendoCalender("CalenderName", new { style = "width: 180px;height:200px;font-size:13px" }) 

컨트롤러 조치 방법을 추가 할 필요가 없습니다.