viewmodel get object, set property

4 posts, 2 answers
  1. Bilal
    Bilal avatar
    109 posts
    Member since:
    Oct 2014

    Posted 18 Feb 2015 Link to this post

    Hi,

    Does the viewmodel trigger any change event when something like this is used:
    viewmodel.get("obj1").prop1 = "New value"

    Also, does the Data Source trigger change event when something like this is used:
    viewmodel.get("signatureDatasource").data(e.signatures);


    Thanks
  2. Answer
    Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 20 Feb 2015 Link to this post

    Hello,

    You should use the setter method in order to trigger changes; using direct assignment does not work. Such questions are frequently discussed in our forums.

    The datasource data method will trigger a change in the observable object automatically, due to the datasource internal change tracking mechanisms. 

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Bilal
    Bilal avatar
    109 posts
    Member since:
    Oct 2014

    Posted 20 Feb 2015 in reply to Petyo Link to this post

    Thanks a lot. Using "set" means it will trigger change on viewmodel (observable) correct?

    Best regards
    Bilal Haidar
  5. Answer
    Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 24 Feb 2015 Link to this post

    Hi,

    yes, that's correct. 

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready