Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KendoUI ObservableObject: Set multiple attributes

I'm using a kendo.data.ObservableObject, and want to change two attributes at once (so the change-event doesn't get fired twice). I'm not sure of the syntax (background.set('id', backgroundId) for a single attribute), and the documentation isn't of much help. Any help?

Thanks!

like image 720
Steven Avatar asked Feb 26 '13 20:02

Steven


1 Answers

You cannot set more than one attribute at once. You need to call the set method twice.

If you just want to avoid triggering the change event assign the attribute without using the set method:

model.foo = "foo" ; // won't trigger "change"
model.set("bar", "bar"); // will trigger "change"
like image 179
Atanas Korchev Avatar answered Oct 05 '22 15:10

Atanas Korchev