scheme_setter question

Unlike the other setters, the “scheme_setter” does not save the scheme into “this.config”. Is it possible to fix it?

https://snippet.webix.com/m7k6twzy

Hello @lBeJIuk,

Unlike the other setters, the “scheme_setter” does not save the scheme into “this.config”. Is it possible to fix it?

While it is true that some setters return the value they have set, this is not always the case (in fact, it is also quite common that they don’t return return anything, like in this case). The main purpose of a setter is to read the config of the component and call the respective methods to handle the set properties.

Could you please clarify your use case, and why you would deem it necessary to return the scheme that was set (not to mention that if you were to set the data scheme using keys, you wouldn’t be able to read much into it either way)?

In your particular case, you could store the scheme separately and refer to it as needed. Or, you can even store it inside the component by attaching the scheme to a custom property with no logic attached to it, i.e.: Code Snippet.

Hi @Dzmitry,
thank you for the answer! I want to make a clone of DataCollection(https://forum.webix.com/discussion/37972/clone-datacollection#latest). I tried to copy the configuration from “this.config.scheme” and found “undefined” instead.
Thank you for the variant with custom property. I will think about whether it will suit me. At the moment, I override “scheme_setter” and return the value.