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

MVVM set viewModel property Error

1 Answer 72 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Neeraj
Top achievements
Rank 1
Veteran
Neeraj asked on 08 Jun 2018, 08:28 AM
     Hello,
              I have viewModel and model that has additional property. Following Statements get executed

$.extend(viewModel, kendo.observable(model));
var RData = viewModel.Receipts;
var TstDataSource = new kendo.data.DataSource({
                    data: RData,
                    group: [{ field: "Code", dir: "asc" }]
                });
 
viewModel.set("Receipts",TstDataSource);
RefreshServiceElements();
kendo.bind($("#Container"), viewModel);


On viewModel.set("Receipts",TstDataSource);    , i get error maximum call stack size exceeded. 

Receipts property is bind to Grid in MVVM

When i use viewModel.Receipts=TstDataSource it works, i just wanted to know why it works . And then should i update the Item in Receipts using 'set' or '=' ?
P.S: viewmodel is not global

 

 

 

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 12 Jun 2018, 06:37 AM
Hello Neeraj,

Do you get the exception only when Receipts is bound to the Grid, or it is thrown event without binding it to the Grid? Could you post a dojo example that demonstrates the issue?

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
MVVM
Asked by
Neeraj
Top achievements
Rank 1
Veteran
Answers by
Ivan Danchev
Telerik team
Share this question
or