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

kendo.observable not getting non-enumerable own-properties

1 Answer 93 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 09 Apr 2014, 03:44 PM
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

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 11 Apr 2014, 08:20 AM
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. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MVVM
Asked by
Chris
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or