I'm trying to set values on a model object (kendo.data.Model, which is an ObservableObject in the covers according to the documentation on the set property), but I'm in a race condition with the change event.
In other words, I try setting a value and then mark it as "not dirty" so that it doesn't get posted back to the server, but I can't.
For example, if I do this in my success method after a POST to create an object:
someItem.set('anyFieldUpdateByTheServer', data.anyFieldUpdateByTheServer);
someItem.set('dirty', false);
I will immediately get a PUT because I'm updating the field.
Is there a way of setting properties on an object, WITHOUT causing a postback to the server. I'm assuming that I'm supposed to use 'set' to update properties on Model objects since things don't always work on the view if you forget to do this. Is there perhaps a way of setting something and marking it as "not dirty" at the same time? I'm also having the very same issue with client side properties like calculated amount fields. They are client side only, but I put them on an kendo.data.Model so that the view updates. I just don't want them causing post back to the server.
In other words, I try setting a value and then mark it as "not dirty" so that it doesn't get posted back to the server, but I can't.
For example, if I do this in my success method after a POST to create an object:
someItem.set('anyFieldUpdateByTheServer', data.anyFieldUpdateByTheServer);
someItem.set('dirty', false);
I will immediately get a PUT because I'm updating the field.
Is there a way of setting properties on an object, WITHOUT causing a postback to the server. I'm assuming that I'm supposed to use 'set' to update properties on Model objects since things don't always work on the view if you forget to do this. Is there perhaps a way of setting something and marking it as "not dirty" at the same time? I'm also having the very same issue with client side properties like calculated amount fields. They are client side only, but I put them on an kendo.data.Model so that the view updates. I just don't want them causing post back to the server.