jQuery UI Widgets Forums Navigation Tree nobodys talking about angular_jqxtree

This topic contains 16 replies, has 3 voices, and was last updated by  rlopez 4 years, 9 months ago.

Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
  • nobodys talking about angular_jqxtree #89558

    Hristo
    Participant

    Hello junior,

    Unfortunately, I have not noticed that you use the same variable for two different things.
    If this.beverages is an Array with data and want to use the DataAdapter need to set this to localdata field.
    Please, take a look at this demo (localdata):
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/treebindingtojson.htm?light

    Another option is to load data from the server then use url (String) and set a concrete URL address.
    Please, take a look at this demo (url):
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/treebindingxml.htm?light

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    nobodys talking about angular_jqxtree #97727

    rlopez
    Participant

    Hi.
    I’m starting with jqWidgets.
    Hope this helps

    
    source: any;
    dataAdapter: any;
    records: any[];
    entidadRolTipoTree: any[];
    @ViewChild('myTree') myTree: jqxTreeComponent;
    
    getEntidadRolTipoTree(): any {
            this.pgql.query(this._service.entidadRolEstructuraQuery(1)).subscribe(response => {
                    if (response.ok) {
                        this.entidadRolTipoTree = response.body.data.getEntidadRolTree.nodes;
                        this.source = {
                            datatype: 'json',
                            datafields: [
                                {name: 'id'},
                                {name: 'parentid'},
                                {name: 'text'}
                            ],
                            id: 'id',
                            localdata: this.entidadRolTipoTree
                        };
                        // create data adapter & perform Data Binding.
                        this.dataAdapter = new jqx.dataAdapter(this.source, {async: true, autoBind: true});
                        // specifies the mapping between the 'text' and 'label' fields.
                        this.records = this.dataAdapter.getRecordsHierarchy('id', 'parentid', 'items', [{name: 'text', map: 'label'}]);
    
                        this.myTree.source(this.records);
    
                    }
    
                },
                err => {
                    throw err;
                });
        }
    
      ngOnInit() {
            this.getEntidadRolTipoTree();
        }
    • This reply was modified 4 years, 9 months ago by  rlopez.
Viewing 2 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic.