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

Error : Uncaught TypeError: Cannot read property 'replace' of undefined

3 Answers 2077 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Neeraj
Top achievements
Rank 1
Veteran
Neeraj asked on 04 Oct 2018, 04:10 AM
Hello ,
              When i bind my viewModel with selector div ,as shown below,
kendo.bind($("#SampleDivContainer"), viewModel);

  following error is shown and app is crashed :
    Uncaught TypeError: Cannot read property 'replace' of undefined

            Is it template error or viewModel error, is there some idenfication/error document which can help me to handle error like this in future?

3 Answers, 1 is accepted

Sort by
0
Neeraj
Top achievements
Rank 1
Veteran
answered on 04 Oct 2018, 04:12 AM

[quote]Neeraj said:Hello ,
              When i bind my viewModel with selector div ,as shown below,
kendo.bind($("#SampleDivContainer"), viewModel);

  following error is shown and app is crashed :
    Uncaught TypeError: Cannot read property 'replace' of undefined

            Is it template error or viewModel error, is there some idenfication/error document which can help me to handle error like this in future?[/quote]

When i refresh the page, it works fine and error doesnt occur.

 

 

0
Neeraj
Top achievements
Rank 1
Veteran
answered on 04 Oct 2018, 04:13 AM
When i refresh the page and again call same function, everything works fine. I dont want to refresh page. everything is asynchronous
0
Neli
Telerik team
answered on 05 Oct 2018, 01:06 PM
Hi Neeraj,

In order to be able to help you we will need more details about the exact implementation. I will appreciate if you could send us a small runnable example where the issue is replicated.
Here you will find the MVVM template binding Demo, that could help.
Such error is discussed also in the Forum thread linked here.

Regards,
Neli
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
MVVM
Asked by
Neeraj
Top achievements
Rank 1
Veteran
Answers by
Neeraj
Top achievements
Rank 1
Veteran
Neli
Telerik team
Share this question
or