jQuery UI Widgets Forums Navigation Tree nobodys talking about angular_jqxtree

This topic contains 18 replies, has 5 voices, and was last updated by  svetoslav_borislavov 1 year ago.

Viewing 4 posts - 16 through 19 (of 19 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 6 years, 4 months ago by  rlopez.
    nobodys talking about angular_jqxtree #132771

    noscogeorge
    Participant

    I have a json object sample as fellow

    [
        { 
           "name": "Radiology & Test(Rad)",       
            "children": [
                {
                    "name": "RAD Abdomen",
                    "fk_parent": 26,
                    "code": null,
                    "service_code": null,
                    "service_description": null,
                    "children": [],
                    "claim_history": []
                },
                {
                    "name": "RAD Lower Limb",
                    "fk_parent": 26,
                    "code": null,
                    "service_code": null,
                    "service_description": null,
                    "children": [],
                    "claim_history": []
                }
            ],
            "claim_history": [    
                {
                    "s_code": "RAD-050",
                    "s_description": "Electrocardigram (ECG)",
                    "children": null
                }
            ]
          }
    ]

    here is my angular

    source =
    {
    dataType: “json”,
    dataFields: `[
    { name: ‘unqkey’, type: ‘number’ },
    { name: ‘fk_parent’, type: ‘number’ },
    { name: ‘name’, type: ‘string’ },
    { name: ‘s_code’, type: ‘string’ },
    { name: ‘count_hst_not_approved’, type: ‘number’ },
    { name: ‘count_hst_approved’, type: ‘number’ },
    { name: ‘children’, type: ‘array’ },
    { name: ‘claim_history’, type: ‘array’ },

    ]`,
    hierarchy:
    {
    root:’children’
    },

    id: ‘unqkey’,
    localData:this.dataNode,

    };
    how do add the second array to the hierarchy because this is what i want to achieve
    [![enter image description here](https://i.stack.imgur.com/SMllh.png)](https://i.stack.imgur.com/SMllh.png)

    I tried to
    this.treeGrid.addRow(chid.unqkey,{s_code: ‘DavidTest’,s_description:”,count_hst_approved:”,count_hst_not_approved:”},’2′); it did not work
    I also tried
    hierarchy:
    {
    root:’children’+’claim_history’
    }
    but it did not work

    Hi,

    You cannot have more than one array in the hierarchy.
    What you are trying to do is not possible

    If we can help you with something else, let us know!

    Best regards,
    Svetoslav Borislavov

    jQWidgets Team
    https://www.jqwidgets.com/

Viewing 4 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic.