kendo-labs / breeze-kendo

13 stars 10 forks source link

Project query #8

Closed gkrit closed 10 years ago

gkrit commented 10 years ago

Getting entity.entityAspect is undefined

wardbell commented 10 years ago

How about some more information?

gkrit commented 10 years ago

making a project query var theQuery = breeze.EntityQuery.from('Events') .select('Id,Name,Descr,InsertDate');

generates an error in breeze-kendo in line 226 - function syncItems

   .............................
    entity.entityAspect.propertyChanged.subscribe(protect(function(ev){
        observable.set(ev.propertyName, ev.newValue);
    }));
    ..................................................

Error entity.entityAspect is undefined

wardbell commented 10 years ago

That's because the object returned from a "select" query is never an entity and would not be in cache. It's a projection over an entity.

You can project into an entity with the toType clause but you really need to understand what you're doing when you do that or you will male other mistakes down the line if you try to edit and save.

The documentation covers this point as does John Papa's Pluralsight course.

HTH