Servoy / servoy-extra-components

NGClient component package of all kinds of 'extra' components
MIT License
6 stars 10 forks source link

How to use DBTreeView createRelationInfo? #65

Closed juanetec closed 4 years ago

juanetec commented 4 years ago

I am starting to use the DBTreeView It works well, but I try to use the createRelationInfo there is no documentation about that. I try to use to have to different relation but I don't know the way to do that. With the below code it works only the first relationInfo but I only have defined one TextDataprovider, how to defined the second? Can I?

` var /* @type {CustomType} / _relationInfo, /* @type {Array<CustomType>} / _relationInfos = [];

elements.dbtreeview.setNRelationName(controller.getDataSource(), 'categories_to_categories_parent_childs');
elements.dbtreeview.setTextDataprovider(controller.getDataSource(), 'categoryname');

   _relationInfo = elements.dbtreeview.createRelationInfo('Categories','categories_to_categories_parent_childs');
_relationInfos.push(_relationInfo);
_relationInfo = elements.dbtreeview.createRelationInfo('Items,'categories_to_items');
_relationInfos.push(_relationInfo);
elements.dbtreeview.setNRelationInfos(datasources.db.example.categories.getDataSource(),_relationInfos);
`

Un Saludo

Juan Ramírez

gboros commented 4 years ago

you also need to set the 'text dataprovider' for the 'items' datasource, used in the 'categories_to_items' relation, similar as you defined for the 'categories' datasource

juanetec commented 4 years ago

ok thanks.

Un Saludo

Juan Ramírez