too much recursion, loading multiselect options

Hi

I have a problem with a service, this service have many DataCollection, and work fine but when i try to load multiselect view using the service get "TOO MUCH RECURSION " error,

Please help.

Thanks in advance.

//dataService.js
export default function init(app) {

    /*Retorna todos los códigos de locales i18n*/
    const othersdata = new webix.DataCollection({
        [........]
    });

    /*return roles*/
    const dataRoles = new webix.DataCollection({
        url: "/api/getroles",
        datatype: "json"
    });
}

In app.js field into constructor

import { JetApp, HashRouter, plugins } from "webix-jet";
import  recordService from "../sources/models/dataService";
[....]
export default class app extends JetApp {
    constructor(config) {
        const defaults = {
            id: APPNAME,
            [......]


       this.setService("recordService", recordService(this));

}

When i try to use recordservice in a another page send too much recursion error.

import { JetView, plugins } from "webix-jet";

export default class RolesView extends JetView {
config(){

          let dataroles= this.app.getService("recordService").dataRoles;

           var selectRole = {
            view: "multiselect",
            label: _("permissions_form_title"),
            id: "permissionRoles",
            name: "permissionRoles",
            labelWidth: 150,
            options: dataroles,
            labelPosition: "top")
        };
        [....]

}
}

Thanks in advance

Similar code works for me
https://snippet.webix.com/deoip3x4

"TOO MUCH RECURSION " error,

Such error can occur if you are inserting some complex object into the UI config ( result of config method ) Code makes a copy of configuration and may fail on complex custom objects. In the same time, the code has a special check for DataCollection objects, so they must not cause the issue.

Which version of webix jet are you using by the way?

A bit more verbose alternative to the direct including data in the config, will be to load data from the init method.

https://snippet.webix.com/lnn15366

Ok, Thanks so much.

The webix-jet version was 1.5.3, now update to 1.6.2

Next time i try your solution, I fixed my issue by this way:

  var dataRoles = [];
        webix.ajax().sync().get("/common/getroles", function (text, data) { dataRoles = JSON.parse(text).result.response; });

        var selectRole = {
            view: "multiselect",
            label: _("permissions_form_title"),
            id: "permisssions",
            name: "permissions",
            labelWidth: 150,
            options: dataRoles,
            labelPosition: "top",
            required: true, invalidMessage: _("default_field_empty")
        };