What I'm doing wrong?

3 posts, 0 answers
  1. Ricardo
    Ricardo avatar
    13 posts
    Member since:
    Apr 2013

    Posted 01 May 2014 Link to this post

    I'm trying to load from a kendo-template a window and here is my code. The windows goes empty.

    @Html.Kendo().Window().Width(500).Height(275).Modal(true).Visible(false).Name("newPersonWin").Title("Añadir Estudiante")

    <script>
    function openWindow() {
    var win = $("#newPersonWin").data("kendoWindow");
                    $("#newPersonWin").data("kendoWindow").refresh({
                        content: {
                            template: $("#newPersonTemplate").html()
                        }
                    });
                    
                    win.open().center();
    }

    </script>
    <script id="newPersonTemplate" type="text/x-kendo-template">
        <div class="container" id="newPersonForm">
                <div class="form-group">

                    <input class="k-textbox" id="ActivityPersonFirstName" name="ActivityPersonFirstName" placeholder="Nombre" required="required" style="text-transform:capitalize;" type="text" value="" />
                    <input class="k-textbox" id="ActivityPersonInitName" name="ActivityPersonInitName" placeholder="Inicial" style="text-transform:capitalize;" type="text" value="" />
                </div>
                <div class="form-group">

                    <input class="k-textbox" id="ActivityPersonLastName1" name="ActivityPersonLastName1" placeholder="Apellido P" required="required" style="text-transform:capitalize;" type="text" value="" />
                    <input class="k-textbox" id="ActivityPersonLastName2" name="ActivityPersonLastName2" placeholder="Apellido M" required="required" style="text-transform:capitalize;" type="text" value="" />
                </div>
                <div class="form-group">

                    <input class="k-textbox" id="ActivityPersonPhone1" name="ActivityPersonPhone1" placeholder="Telefono 1" required="required" type="text" value="" />
                    <input class="k-textbox" id="ActivityPersonPhone2" name="ActivityPersonPhone2" placeholder="Telefono 2" type="text" value="" />
                </div>
                <div class="form-group">

                    <input class="k-textbox" id="ActivityPersonSocSec" name="ActivityPersonSocSec" placeholder="Seguro Social" required="required" type="text" value="" />
                </div>
                <div class="form-group">

                    <a id="btnSometer" onclick="someter()" class="k-button">Someter</a>
                    <a id="btnCancelar" onclick="cancelar()" class="k-button">Cancelar</a>
                </div>
            </div>
    </script>
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 02 May 2014 Link to this post

    Hello Ricardo,

    The refresh method is used for fetching remote data, and since none is fetched, the template is not rendered. If you simply want to set the content of the window to some HTML, use the content mehtod. Here is a snippet that shows how to do this.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Ricardo
    Ricardo avatar
    13 posts
    Member since:
    Apr 2013

    Posted 05 May 2014 in reply to Alex Gyoshev Link to this post

    Thanks that did the trick. Things like that should be documented in API.
Back to Top