kendo.observable not getting non-enumerable own-properties

2 posts, 0 answers
  1. Chris
    Chris avatar
    3 posts
    Member since:
    Jul 2013

    Posted 09 Apr 2014 Link to this post

    Is there a way to make kendo.observable set up non enumerable properties from the object you give it?  For example:

    var someObject = {};
    someObject.x = 5;
    Object.defineProperty(someObject, "someString", {
        enumerable: false,
        configurable: false,
        writable: true
    someObject.someString = "This is the base";
    var foo = kendo.observable(someObject)
    "x" in foo;  //true
    "someString" in someObject;  //true
    "someString" in foo;  //false, but I want this to be true
  2. Petyo
    Petyo avatar
    2436 posts

    Posted 11 Apr 2014 Link to this post

    Hi Chris,

    the kendo observable call uses enumeration to iterate through the passed object properties - the code can't actually "figure out" that someString is present. A thing which comes to mind is to define the property to the observable result - I am not sure if this makes sense in your scenario, though. 

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top