For this panel content, the panel frame url_name must be frame_table, and it must have a url_action_name for the Automail URL controller to find the panel content.
Below is an example configuration of a panel using the Table module:
order_by the model field (str) or fields (list) to order the table by when loading (by default ascending alphanumeric order, for descending order use the prefix "-" (e.g. "-id"))
is_empty sets whether the table should be empty by default until the user clicks the Search button (must have a selectpickers section on top of the page)
init_max_rows_threshold the maximum number of rows that will be displayed without the user clicking the Search button
table_settings the table-level configuration
Create an uploadfile__.py to upload the table in database
For each column name in "field_definition", you can set up additional settings for the table
"field_definitions":{"survey":{"source": custom_models.KEY_MATERIAL_SURVEYS,},"question":{"width":300,"validations": [{"name":"custom","params":{"function": custom_functions.validate_question_exist,"message":"The question(s) are not valid for the corresponding survey. <br>",},} ],},"answer":{"width":300,},"survey_contact_email":{"transformations": ["lower",{"name":"sort_alphabetical_split_by_separator","params":{"separator":",",},}, ],"validations": [{"name":"custom","params":{"function": custom_functions.validate_contact_email,"message":"Only valid email addresses allowed for",},}, ],},"update_timestamp":{"read_only":True},"user_id":{"read_only":True},},
source the value in each row for the column should be in the field of the list you provided
width set up the initial width for the column
validations will validate the input value in the column and provide the message showing when the validation fails. You can set up the custom function in function.py like this