This is a migrated thread and some comments may be shown as answers.

Scheduler MVC Retrieve Current Date Range

1 Answer 71 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
ICT
Top achievements
Rank 1
ICT asked on 10 Jan 2018, 05:39 AM

Hi 

I've found a link which shows how to retrieve the current date range of a view using JQuery :

https://docs.telerik.com/kendo-ui/controls/scheduling/scheduler/how-to/various/view-date-range

I want to allow users to search resources via the currently selected date range.

Is there a way to do this in MVC?

 

Thank you

Phil

 

 

 

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 11 Jan 2018, 03:18 PM
Hi Phil,

Both the Kendo UI Scheduler and its MVC wrapper use the same API so the approach for getting the current date range would be identical. The difference would be the event handlers attachment in the MVC Scheduler:
.Events(e =>
{
    e.DataBound("onDataBound");
    e.Navigate("onNavigate");
})

But the rest of the logic would be the same:
<div class="console"></div>
 
<script type="text/javascript">
    function onDataBound(e) {
        $(".console").append("<p><strong>Navigated to:</strong></p>");
        scheduler_view_range(e);
    }
 
    function onNavigate(e) {
        $(".console").append("<p><strong>Navigated from:</strong></p>");
    }
 
    function scheduler_view_range(e) {
        var view = e.sender.view();
 
        $(".console").append("<p>" + kendo.format("view:: start: {0:d}; end: {1:d};", view.startDate(), view.endDate()) + "</p>");
    }
</script>

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Scheduler
Asked by
ICT
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or