Page 1 of 1

Table View - Enable/Disable per row

PostPosted: Tue Jun 09, 2020 1:54 am
by patrick1569617634
So I have a table that I'm displaying in a form Table View (Locked), where the button does some action

|ID|Status|Button|
|1|Good|Button|
|2|Great|Button|
|3|Bad|Button|

Basically, what I want is to disable the button on each row if the status === 'Bad'
But setting the enabled property of the button sets it for all the buttons on the list.

Is there an easy solution I'm missing?

Thanks!

Re: Table View - Enable/Disable per row

PostPosted: Wed Jun 10, 2020 7:56 am
by swingman
HI,

Not sure which Servoy you are using and what client you are deploying.
In NGClient, if you are using a table-component or any other component where the columns have a StyleClassDataProvider, you can do the following:

1. Create an unstored calculation in your table which returns a style-name when status == 'Bad'. A calculation like

if(status == 'Bad') return 'bad-status';

2. In your CSS, add something like

.svy-button .bad-status { display: none; }

3. select your calculated field as StyleClassDataProvider.

Hope this helps,

Re: Table View - Enable/Disable per row

PostPosted: Wed Jun 10, 2020 9:56 pm
by patrick1569617634
Christian,

Thanks, that helped!