Set Title for Dialog window dynamically

4 posts, 0 answers
  1. Jon
    Jon avatar
    73 posts
    Member since:
    Oct 2013

    Posted 29 Jan Link to this post

    Hi I am trying to set the title of my dialog window dynamically but get an error 

    Uncaught TypeError: Cannot read property 'title' of undefined     
  2. Jon
    Jon avatar
    73 posts
    Member since:
    Oct 2013

    Posted 29 Jan Link to this post

    Post posted on clicking tab before I had finished...

    The code I am using is

    dialog.data("kendoDialog").title('Editing: @Model.Application')

     

    How should I set my title dynamically...

  3. Nencho
    Admin
    Nencho avatar
    1822 posts

    Posted 31 Jan Link to this post

    Hello Jon,

    The demonstrated implementation seems to be correct and it is working properly at my end. In the dojo example below, you can observe the behavior at my end:

    https://dojo.telerik.com/@nenchef/upEDiBaT/4
    1. Close the DIalog
    2. Click the `change title` button
    3. Click the `open dialog` button
    result: the title is changed

    Could you please try it at your end and modify it in a manner so we could replicate the issue at ours. 

    On a side note, the reason for the issue might be if a reference to the dialog widget is not acquired, prior to the invoking of the title method. Please make sure that you are correctly getting a reference to the widget (....data("kendoDialog"))

    Hope this would help.

    Regards,
    Nencho
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  4. Nencho
    Admin
    Nencho avatar
    1822 posts

    Posted 31 Jan Link to this post

    Hello Jon,

    The demonstrated implementation seems to be correct and it is working properly at my end. In the dojo example below, you can observe the behavior at my end:

    https://dojo.telerik.com/@nenchef/upEDiBaT/4
    1. Close the DIalog
    2. Click the `change title` button
    3. Click the `open dialog` button
    result: the title is changed

    Could you please try it at your end and modify it in a manner so we could replicate the issue at ours. 

    On a side note, the reason for the issue might be if a reference to the dialog widget is not acquired, prior to the invoking of the title method. Please make sure that you are correctly getting a reference to the widget (....data("kendoDialog"))

    Hope this would help.

    Regards,
    Nencho
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top