Hiding columns (and re-activating)

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Hiding columns (and re-activating)

Postby patrick1645350822 » Sat Aug 20, 2022 4:11 pm

Hello guys,

I am trying to hide / show columns via coding depending on filters:
Code: Select all
   case TASK_FILTER.WORKEDON:
      elements.btnNew.addStyleClass('bg-info');
      elements.table.columns.forEach(function(column) {
         if (column.id == "taskstartdate") {
            column.visible = false;
          //|| column.dataprovider == "taskenddate") {
         } else if (column.dataprovider == "totalTimeregFormatted") {
            column.visible = true;            
         }
      });   
      break;


This works perfectly until... I hide more than 2 columns. Only one column is then showing again when setting them to visible = true.
The columns are stil available in the code but will not show anymore.
Tried several things even hard coding the column number via elements.table.columns[1].visible all with the same result.

Any ideas?
Greetings,

Patrick Marelis
Sileram BV
https://sileram.nl
patrick1645350822
 
Posts: 37
Joined: Sun Feb 20, 2022 11:53 am

Return to Web Development

Who is online

Users browsing this forum: No registered users and 9 guests