Changing title at runtime

6 posts, 1 answers
  1. Alberto
    Alberto avatar
    71 posts
    Member since:
    May 2012

    Posted 22 May 2013 Link to this post

    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!
  2. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 22 May 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Alberto
    Alberto avatar
    71 posts
    Member since:
    May 2012

    Posted 31 May 2013 Link to this post

    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
  5. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 03 Jun 2013 Link to this post

    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!
  6. Alberto
    Alberto avatar
    71 posts
    Member since:
    May 2012

    Posted 05 Jun 2013 Link to this post

    ok got it!

    thank you both
  7. Coty
    Coty avatar
    41 posts
    Member since:
    Jun 2014

    Posted 19 Feb in reply to Alberto Link to this post

    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);

Back to Top
Kendo UI is VS 2017 Ready