Types¶
Types are defined for grid JSON input/output. These can be mirrored on the consumer side for API integrity (e.g. in TypeScript).
Typically, in API usage, the consumer app will be building/maintaining a GridSettings
object to send to the API, and accepting a Grid
in response.
Settings Types¶
- class webgrid.types.Filter(op: str, value1: Union[str, List[str]], value2: Union[str, NoneType] = None)[source]¶
- class webgrid.types.Paging(pager_on: bool = False, per_page: Union[int, NoneType] = None, on_page: Union[int, NoneType] = None)[source]¶
- class webgrid.types.GridSettings(search_expr: Union[str, NoneType] = None, filters: Dict[str, webgrid.types.Filter] = <factory>, paging: webgrid.types.Paging = <factory>, sort: List[webgrid.types.Sort] = <factory>, export_to: Union[str, NoneType] = None)[source]¶
- classmethod from_dict(data: Dict[str, Any]) GridSettings [source]¶
Create from deserialized json
Grid Types¶
- class webgrid.types.FilterOperator(key: str, label: str, field_type: Union[str, NoneType], hint: Union[str, NoneType] = None)[source]¶
- class webgrid.types.FilterSpec(operators: List[webgrid.types.FilterOperator], primary_op: Union[webgrid.types.FilterOperator, NoneType])[source]¶
- class webgrid.types.GridSpec(columns: List[Dict[str, str]], column_groups: List[webgrid.types.ColumnGroup], column_types: List[Dict[str, str]], export_targets: List[str], enable_search: bool, enable_sort: bool, sortable_columns: List[str], filters: Dict[str, webgrid.types.FilterSpec] = <factory>)[source]¶
- class webgrid.types.Grid(settings: webgrid.types.GridSettings, spec: webgrid.types.GridSpec, state: webgrid.types.GridState, records: List[Dict[str, Any]], totals: webgrid.types.GridTotals, errors: List[str])[source]¶