Kendo Window Content model values not persisted

2 posts, 0 answers
  1. Karl
    Karl avatar
    9 posts
    Member since:
    Oct 2012

    Posted 25 Jun 2015 Link to this post

    I have the following window code with 2 date picker controls which read and write to 2 date properties on my model

    The window can read the properties fine, but can never set them, even though if I re-open the window control it knows what the new values are.

    Is there some kind of validation or commit function that needs to called before closing the window object?

     @(Html.Kendo().Window()
        .Name("ReportRefreshOptionsDialog")
        .Title("Schedule Report Options")    
        .Content(@<text>
             <div class ="left" width:100px>From:</div>
             @(Html.Kendo().DatePicker()
                .Name("Model.ScheduleReport.FromDate")
                .Value(Model.ScheduleReport.FromDate)
                .HtmlAttributes(new { style = "width:150px" })
             )

             <div class ="left" width:100px>To:</div>
             @(Html.Kendo().DatePicker()
                .Name("Model.ScheduleReport.ToDate")
                .Value(Model.ScheduleReport.ToDate)
                .HtmlAttributes(new { style = "width:150px" })
             )        
          <p></p>
          <div align="right"><button id="btnReportOptionsOk">Ok</button></div>
         </text>)
        .Modal(true)
        .Width(250)
        .Visible(false)
        .Actions(actions => actions.Close())
    )

     

     

  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 29 Jun 2015 Link to this post

    Hi Karl,

    I don't see where you are submitting the new values to the server? This is not the Window's job and you need to take care of it, e.g. by using a form inside the WIndow or an Ajax request. With regard to forms, please read:

    http://docs.telerik.com/kendo-ui/web/window/overview#using-kendo-ui-window-with-a-form

    Regards,
    Dimo
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top