A model wrapper is an utility used to wrap a database model and provide a consistent interface over it. It allows automatically adding new rows to the database, updating existing rows, and deleting rows.
You can use the basic functionality of the model wrapper by using the rxe.model_wrapper
function. This function takes a database model and returns a wrapper object that can be used to interact with the model.
By default the model_wrapper use the infinite rows model from AgGrid.
If the default model wrapper does not fit your needs, you can create a custom model wrapper by subclassing the rxe.ModelWrapper
class. This allows you to customize the behavior of the model wrapper to fit your specific use case.
In the custom model wrapper, you can override the following methods:
_get_columns_defs
_get_data
_row_count
on_value_setter
to modify how the model wrapper will behave.
The SSRM model wrapper, used with rxe.model_wrapper_ssrm
, is a version of the model wrapper that allows you to use the ServerSideRowModel of AgGrid.
In the same way you can extend the default model wrapper, you can extend the SSRM custom model wrapper by subclassing the rxe.ModelWrapperSSRM
class. This allows you to customize the behavior of the model wrapper to fit your specific use case.
The overridable methods are the same as the standard model wrapper.