Skip to Content
author's profile photo Former Member
Former Member

How to detect if JSON model changed?

Hi,

I basically need to know if the JSON model of my m.List changed.

How can i do this?

Alternately, if I get an event that tells me if the items were added or removed from my sap.List will also do.

I need to update some other controls based on the change in my JSON model.

Please help.

Thanks

Amjad

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 12, 2014 at 09:36 AM

    What you probably want to do is to subscribe to the change event of the binding. Try something like:

    oList.getBinding("items").attachChange(myCallback);

    - Max

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 12, 2014 at 12:18 PM

    you can have an object which has the original model and another object which contains the modified model and then compare them to see if they are still equal or not.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.