Kendo Window Content model values not persisted

4 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
    8406 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. Raj
    Raj avatar
    24 posts
    Member since:
    Nov 2016

    Posted 02 Oct Link to this post

    Hi 

    I am using Angular objects with in html to populate fields. kendo window is unable to grab those values from angular objects on a page.

    it is working fine if i display directly on page but if i display in Kendo window it is not.

    please find the code.

       @(Html.Kendo().Window()
        .Name("OutfallInfo")
        .Title("Outfall List")
        .Visible(false)
        .Content(@<text>
            <div class="container" align=center>
                <div id="dialog-message" ng-controller="echoController">
                    <div ng-repeat="facility in result.Results.PermFeatures">

                        <ul>
                            <li>{{facility.PermFeatureNmbr}}-{{facility.PermFeatureTypeDesc}}</li>
                        </ul>
                    </div>
                </div>
            </div>
        </text>)
            )

    //angular Code

      var myapp = angular.module('myapp', []);
        myapp.controller('echoController', function ($scope, $http) {
            $scope.spinner = false;
            $http.get('https://ofmpub.epa.gov/echo/eff_rest_services.get_effluent_chart?output=json&p_id=@Model.NPDES').then(function (response) {
                $scope.result = response.data;
                if (result = !null) {
                    $scope.spinner = true;
                }
            });
        });

    But im getting results as following -> Please find attached Image for kendo window.

    Raj.

  4. Dimo
    Admin
    Dimo avatar
    8406 posts

    Posted 04 Oct Link to this post

    Hello Raj,

    The observed behavior is caused by the fact that the Window is moved in the DOM. The following documentation section provides information on possible options:

    http://docs.telerik.com/kendo-ui/AngularJS/introduction#widgets-placed-in-window

    - use the appendTo option to append the window to another HTML element which is part of the Angular application and scope, or
    - initialize the AngularJS application on the body.

    On a side note, please consider opening new forum threads for issues that are unrelated to the original discussion. This will facilitate focused and streamlined communication. Thank you for understanding.

    Regards,
    Dimo
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top