AnsweredAssumed Answered

Re-render dropdown after this.model.set?

Question asked by Adrian Dinu on Aug 6, 2015
Latest reply on Aug 6, 2015 by Adrian Dinu
Hi everyone!

I want to set the value of a dropdown programmatically, in the create-actions.js, with this.model.set. The value changes, no problem, but the field doesn't render with the new value, so until you deploy de dropdown by clicking on it, you can't actually see the change. I was wondering if there is a way to triger rendering of individual fields from the view. Isn't it supposed to do it automatically when you call the get() function?
Anyway, I found a "trick" that will trigger the rendering of the dropdown, but I don't think this is the way we are supposed to do it:
this.model.fields.(dropdown_name).options = this.model.fields.(dropdown_name).options;
By reseting the options list of the dropdown, Sugar re-renders it.
Does anyone know a better way? Or if it should re-render on it's own uppon calling the this.model.get() and maybe it's buggy?


I'm on 7.6 PRO by the way