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

What I'm doing wrong?

2 Answers 73 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 01 May 2014, 01:39 PM
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 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 02 May 2014, 03:19 PM
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!
 
0
Ricardo
Top achievements
Rank 1
answered on 05 May 2014, 04:24 PM
Thanks that did the trick. Things like that should be documented in API.
Tags
Window
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Ricardo
Top achievements
Rank 1
Share this question
or