HTML5 Web app开发工具Kendo UI Web教程:如何配置Kendo UI Calendar
admin
2023-06-11 11:20:16
0

Kendo UI Web包含数百个创建HTML5 web app的必备元素,包括UI组件、数据源、验证、一个MVVM框架、主题、模板等。本文来看看如何配置Kendo UI Calendar。

1、创建新的操作方法来显示视图:

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

2、添加日历

WebForms

<%: Html.Kendo().Calendar()
    .Name("calendar") //The name of the calendar is mandatory. It specifies the "id" attribute of the widget.
    .Min(new DateTime(2010, 1, 1, 10, 0, 0)) //Set min time of the calendar
    .Max(new DateTime(2010, 1, 1, 20, 0, 0)) //Set min date of the calendar
    .Value(DateTime.Now) //Set the value of the calendar
%>

Razor

@(Html.Kendo().Calendar()
    .Name("calendar") //The name of the calendar is mandatory. It specifies the "id" attribute of the widget.
    .Min(new DateTime(2010, 1, 1, 10, 0, 0)) //Set min time of the calendar
    .Max(new DateTime(2010, 1, 1, 20, 0, 0)) //Set min date of the calendar
    .Value(DateTime.Now) //Set the value of the calendar
)

访问Existing Calendar

通过jQuery.data()引用一个现有日历实例,一旦建议了引用,就可以使用API来控制它的行为。

访问现有日历实例

//Put this after your Kendo Calendar for ASP.NET MVC declaration

处理Kendo UI Calendar事件

通过Kendo UI Calendar可以订阅所有的事件。

WebForms -由处理程序名称订阅

<%: Html.Kendo().Calendar()
    .Name("calendar")
    .Events(e => e
        .Change("calendar_change")
        .Navigate("calendar_navigate")
    )
%>

Razor -由处理程序名称订阅

@(Html.Kendo().Calendar()
  .Name("calendar")
  .Events(e => e
        .Change("calendar_change")
        .Navigate("calendar_navigate")
  )
)

Razor -通过模板委托订阅

@(Html.Kendo().Calendar()
  .Name("calendar")
  .Events(e => e
      .Change(@
        function() {
            //Handle the change event inline
        }
      )
      .Navigate(@
        function() {
            //Handle the navigate event inline
        }
        )
  )

点击下载Kendo UI Web

相关内容

热门资讯

想去海边过盛夏!华为nova ... 就在刚刚华为终端正式官宣了nova 16系列及全场景新品发布会。说实话,我第一眼看到视频的时候,还真...
华为突破半导体规则引爆中国芯片... 快科技5月25日消息,今天在电气电子工程师学会IEEE主办的2026国际电路与系统研讨会ISCAS现...
宁德,被主机厂“逼”着投Dee... 文 | 超聚焦 DeepSeek的绯闻东家,多了一个宁王。 5月23日,据The Informat...
武契奇被授予“友谊勋章” 5月25日,中华人民共和国“友谊勋章”颁授仪式在北京举行。塞尔维亚总统武契奇被授予“友谊勋章”。(摄...
起底煤矿“暗面”:假整改、假密... 5月22日,山西长治市沁源县通洲集团留神峪煤矿发生瓦斯爆炸,造成82人死亡、2人失联、128人受伤。...
AI驱动文化产业发展:无论技术... 2026文化强国建设高峰论坛人工智能驱动文化产业创新发展论坛22日在深圳举行。与会嘉宾聚焦“AI重构...
原创 美... 原创首发 | 金角财经(ID: F-Jinjiao) 作者 | Chester 中美机器人,到底谁更...
小米SU7现身西班牙塞维利亚 ... 【CNMO科技消息】5月25日,有外媒报道称,近日一辆小米SU7现身西班牙塞维利亚。有技术人士在车内...
从“数字门牌”到“智能入口” ... 人民网记者 黄盛 “十五五”时期,在“人工智能+”行动全面实施的过程中,中文域名如何借助AI技术实现...
通讯|在意大利比萨的实验室看人...   新华社意大利比萨5月25日电 通讯|在意大利比萨的实验室看人与机器人“共生”   新华社记者刁泽...