jQuery UI Widgets › Forums › Navigation › Tree › nobodys talking about angular_jqxtree
Tagged: #jquery-tree, angular tree, angular2 tree, bootstrap tree, javascript tree, jqwidgets tree, jqxtree, typescript tree
This topic contains 18 replies, has 5 voices, and was last updated by svetoslav_borislavov 1 year, 10 months ago.
-
Author
-
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?lightAnother 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?lightBest Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHi.
I’m starting with jqWidgets.
Hope this helpssource: 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(); }
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
[](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 workHi,
You cannot have more than one array in the hierarchy.
What you are trying to do is not possibleIf we can help you with something else, let us know!
Best regards,
Svetoslav BorislavovjQWidgets Team
https://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.