简体   繁体   中英

Kendo UI Scheduler - Changing date format, ASP.NET MVC version

I have the same problem like this: change date format, using javascript

but I'm using the ASP.NET MVC version. There is no 'Databound' element for 'Html.Kendo().Scheduler<...>()'.

So where can I put that 'scheduler_dataBound' function? Or is there another different solution from the javascript version?

There is a data binding event on the MVC wrapper one: You can also do e.Navigate("scheduler_navigate"); and e.DataBound("scheduler_dataBound");

 .Events(e =>
                    {                      
                        e.DataBinding("scheduler_dataBinding");                      
                    })



<script>

function scheduler_dataBound(e) {
    if (this.viewName() != "month") {
        var test = $(".k-lg-date-format").html().split('-'); 
        var _str = kendo.toString(kendo.parseDate(test[0].trim()), 'ddd MM/dd');
        if (test.length == 2) {
            _str += " - " + kendo.toString(kendo.parseDate(test[1].trim()), 'ddd MM/dd');
        } 
        $(".k-lg-date-format").html(_str);
        $(".k-sm-date-format").html(_str); 
    }
}
</script>

Here's a link to the rest of the events http://demos.telerik.com/aspnet-mvc/scheduler/events

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM