Show/Hide column in DBTreeView (dynamically)

Questions and answers on developing, deploying and using plugins and JavaBeans

Show/Hide column in DBTreeView (dynamically)

Postby huber » Mon May 30, 2016 3:41 pm

Hi All

Is there a way to show/hide a column of a DBTreeView? I have a binding of an icon column to the DBTreeView and would like to allow the user to hide/show it from within the application. The code in simplified form looks like:

Code: Select all
var binding = elements.dbTreeView.createBinding(databaseManager.getDataSourceServerName(controller.getDataSource()), databaseManager.getDataSourceTableName(controller.getDataSource()));
...
binding.setImageMediaDataprovider('icon');
...


Regards, Robert
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 516
Joined: Mon May 14, 2012 11:31 pm

Re: Show/Hide column in DBTreeView (dynamically)

Postby Harjo » Wed Jun 01, 2016 9:14 am

Change the underlying foundset. because the DBtreeview is based on foundset's, so if you want hide a column, you have to hide/remove the column from the foundset!
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Show/Hide column in DBTreeView (dynamically)

Postby huber » Wed Jun 01, 2016 10:03 am

Thanks Harjo for your solution. It's exactly what I did. But I thought, there must be a way more elegant solution to it. Like dynamically adding removing the binding of the field. But it doesn't seem so.

Harjo wrote:Change the underlying foundset. because the DBtreeview is based on foundset's, so if you want hide a column, you have to hide/remove the column from the foundset!
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 516
Joined: Mon May 14, 2012 11:31 pm


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 11 guests

cron