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

Manual Update to ViewModel

1 Answer 62 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 15 May 2014, 09:40 AM
I have several views sharing a single ViewModel. In one view, there is a form that updates the ViewModel. The moment I submit the form (before the form handler is called), it triggers a rendering of all observing views (standard behavior of Kendo UI). However, I have an additional attribute that is available only later after some processing within the form handler.

I've tried using the following once the processing is done:

            var prescriptionsDataSource = data.getPrescriptionsDataSource(); // same data source that the view is using in its ViewModel
            var prescription = prescriptionsDataSource.get(prescriptionID);
            prescription.set("medication.reminderCount", reminderCount);

However, this doesn't seem to trigger rendering of the observing views. The result is that the displayed reminderCount is obsolete.

Am I missing something?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Jay
Top achievements
Rank 1
answered on 16 May 2014, 02:49 AM
Please never mind this. It was a clobbered reference. My bad.
Tags
MVVM
Asked by
Jay
Top achievements
Rank 1
Answers by
Jay
Top achievements
Rank 1
Share this question
or