Perspective Table: How to display value in dropdown?

I am wondering if there is a way to display a dataset value in as the dropdown value in the perspective table?

I have the table setup to write the “WAREHOUSE_FUNCTIONAL_AREA” value to a database when it is modified, but I am not able to get the current database value to display in the dropdown box when the table is relaunched. Any help would be appreciated. The dropdown is a view that is tied into the table column.

From my limited experience, your dropdown should be in a view that is used in the table. The view should take two parameters:

  1. The dataset or JSON object containing the options.
  2. The value property of the option to be selected.

You would then bind the dropdown properties to the view parameters.

If the dropdown options are bound to a query, and I have a value parameter on the view, and the table the view is embedded in has a JSON data type, how would I pass each row value to it's respective dropdown view?

Does each row have an awareness of which row it is, so that I could use some sort of getRowIndex or getValueAt function? I realize those two functions need an input, so how would I go about getting that row index so I can get the value for the dropdown?

Views used for cell rendering in a table get a couple automatic parameters:

  • value : the actual value in that cell of the table.

  • rowData : the complete row from props.data where that cell is located.

Your cell rendering view simply needs to declare those input parameters to use them.

1 Like

I don't see how I access those automatic parameters.

image

This is from the embedded view that contains the dropdown. I added a parameter on the dropdown and it's view, so I could pass the value to it, but I'm not sure where to add or how to see those automatic ones you speak of.

You configure those parameters on the view that is specified in the table as the column's rendering view. Then they are available within that view for binding from inner components or embedded views.

Views that are intended to be used as cell rendering views are generally not applicable to other uses, and vice versa.

The value and rowData params are not to be mentioned in the table's columns property, as they are automatically supplied to any rendering view that accepts them.

Got it!