How to change dynamically the datasource of a datagrid column?

I want to create a datagrid where one of the columns will be bound dynamically in a table based on the selected value of another dropdown field. In the attached file, there is a grid where the user selects a value in the ‘Account Type’ column from a group of available values that are {G/L Account, Vendor, Customer, Bank Account}. Based on the selected value, the column ‘Account No’ will be dynamically bound to a different table. Once the available rows of the table will be displayed, the user will select one of them and the field ‘Account No.’ will be filled in with an appropriate value from the related table. Is that possible in the CUBA platform? I was thinking of using the inheritance approach from these tables (there is already a sample CUBA sample app) but I do not know how to implement this behavior on a datagrid.


Could you clarify the following:

  1. Do you need to change DataGrid's column value during inline editing?
  2. What sample CUBA app do you mean?
Regards, Gleb

Hi Gleb,

  1. The answer is yes. When the user selects a value from the dropdown field ‘Account Type’, then the field ‘Account No.’ will be automatically bound to a specific table and the user will be allowed to search for a record in this table. If the user changes the value of the field ‘Account Type’ again, then a new data table will be bound to the ‘Account No.’ field dynamically.

  2. I had in my mind the ‘Entity Inheritance’ (GitHub - cuba-platform/sample-entity-inheritance: DEPRECATED. See sample application but I need a similar behavior in a datagrid.


Currently, there is no ability to change DataGrid’s Editor fields during editing. This feature will be available in the 6.7 release. See this issue.

Thank you very much.