Changing title at runtime

3 Answers 4498 Views
Window
Gaetano
Top achievements
Rank 1
Gaetano asked on 22 May 2013, 09:50 AM
Hi guys, I can't figure out how to change the title after initializing my kendo win.
MyNamespace._myWin =
       $("#recapitoWin").kendoWindow({
       modal: true,
       width: 600,
       visible: false,
       title: "add user"
}).data("kendoWindow");
Now I use this window for add and modify users...
when I need to modify I set the title as follow
MyNamespace._myWin .title = "Edit User";
the result is that the title is still "add user"..no changes.
i tried also
$("#recapitoWin").kendoWindow({
            title: "Edit User"
        }).data("kendoWindow");
but still no changes..
what am I doing wrong?
thanks!

3 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 22 May 2013, 10:34 AM
Hello Fabio,

You need to use the title method.

Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Gaetano
Top achievements
Rank 1
commented on 31 May 2013, 09:02 AM

hello alex, 
OK it seems it'd work that way...
I was just wandering what's the point in having a property (that doesn't work ) and a method...
is the property just for initialization?

thanks anyway! 
fabio
1
Dimo
Telerik team
answered on 03 Jun 2013, 09:56 AM
Hi Fabio,

The title property is for initial configuration only. It cannot work the way you expect, because when you change the property value, the actual Window title (HTML markup) is not aware of that and cannot change automatically. Normally properties in Javascript are used on an incident basis, i.e. a property value is changed and later it is used when necessary. For real-time changes there is a need for a setter, hence the title() method.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Gaetano
Top achievements
Rank 1
commented on 05 Jun 2013, 08:01 AM

ok got it!

thank you both
1
Coty
Top achievements
Rank 1
answered on 20 Feb 2016, 05:43 AM

Old post but I was looking up how to change the title after initialization.  The title bar looks just like a div created above the main window area so you can just update the html using Jquery.  Here is an example that works for me.

    $(winId).kendoWindow({
        modal: true,
        visible: false,
        width: "90%",
        height: "80%",
        title: title
    });

    $(winId).prev().find(".k-window-title").text(title);

Tags
Window
Asked by
Gaetano
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Dimo
Telerik team
Coty
Top achievements
Rank 1
Share this question
or