Property binding of a row value in a table

Hi everybody,

I'm very close to reach the following:

I have a testing table with two columns. The values are for testing only of type boolean (true, false) and defines, whether an icon is shown or not in the corresponding column.

The Icon is rendered correct in the table. Also the viewParams binding is working. Manually I can change the show:true | false and the preview is correct.

But how can I react on row data? I tried to adjust the viewParams to an expression binding and tested {value}. But it seems everything is null even the implicit params: {row:number;rowIndex:number;value:PlainObject;...viewParams}.

How can I test on the PauseIcon view which paramers are available?

Thanks a lot for some hints
Chris

Hi,

In the view that you're embedding, add the param "rowData", then you'll be able to use the data of the row.

See below :
image

Then you can use it like this ( device.bindType is just an example ):

image

You might have to add the properties in the rowData object

1 Like

Perfect. Thanks a lot for the hint. I was not aware of that the parameter has to be defined on the view which is embedded. It also works with value instead of passing the complete row.

Do you know, is there a way to access the column value on the table (the component, which embeds the view). E.g. when I plan to set the view to embed via a condition?

Hmm, not sure I totally get what you're trying to do, but you could always create a binding of the viewPath in the columns property, as well as a binding on render if that's what you need ?

Yes exactly. I tried to add a binding on viewPath.
For example to add different views depending on the column value:

switch({value},True, False, 'Primary/TestIcon', 'Primary/TestIcon2', None)

But I don't know what values I can use in the binding expression.

props.columns is configuration for the table, and doesn't have any way to have different values for different rows of the table. You will need to use a cell render view that can inspect its value (or other rowData) and dynamically select an embedded view of its own.