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

Set Title for Dialog window dynamically

3 Answers 407 Views
Dialog
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 29 Jan 2019, 10:17 AM

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     

3 Answers, 1 is accepted

Sort by
0
Jon
Top achievements
Rank 1
answered on 29 Jan 2019, 10:20 AM

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...

0
Nencho
Telerik team
answered on 31 Jan 2019, 08:22 AM
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.
0
Nencho
Telerik team
answered on 31 Jan 2019, 08:23 AM
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.
Tags
Dialog
Asked by
Jon
Top achievements
Rank 1
Answers by
Jon
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or