Manual Update to ViewModel

2 posts, 0 answers
  1. Jay
    Jay avatar
    23 posts
    Member since:
    Jul 2013

    Posted 15 May 2014 Link to this post

    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!
  2. Jay
    Jay avatar
    23 posts
    Member since:
    Jul 2013

    Posted 15 May 2014 in reply to Jay Link to this post

    Please never mind this. It was a clobbered reference. My bad.
  3. Kendo UI is VS 2017 Ready
Back to Top