Type Hints¶
As described in the DataTables documentation, the client side sends specific format of query parameters to the server side.
When making a request to the server using server-side processing, DataTables
will send data as described in Query in order
to let the server know what data is required.
Once DataTables has made a request for data, with the above parameters sent to
the server, it expects JSON data to be returned to it, with the parameters set
as described in Response.
- class flask_datatables.typing.Column[source]¶
 Bases:
TypedDictColumn data.
- class flask_datatables.typing.ObjectData[source]¶
 Bases:
TypedDictServer-side processing return using objects.
- 
DT_RowAttr: 
Dict[str,Any]¶ Add the data contained in the object to the row
trnode as attributes. The object keys are used as the attribute keys and the values as the corresponding attribute values. This is performed using using the `jQuery`_param()method. Please note that this option requires DataTables 1.10.5 or newer.
- 
DT_RowAttr: 
 
- class flask_datatables.typing.Order[source]¶
 Bases:
TypedDictOrdering information.
- class flask_datatables.typing.Query[source]¶
 Bases:
TypedDictSent parameters.
When making a request to the server using server-side processing, DataTables will send the following data in order to let the server know what data is required.
- 
draw: 
int¶ Draw counter. This is used by DataTables to ensure that the Ajax returns from server-side processing requests are drawn in sequence by DataTables (Ajax requests are asynchronous and thus can return out of sequence). This is used as part of the
drawreturn parameter (see below).
- 
length: 
int¶ Number of records that the table can display in the current draw. It is expected that the number of records returned will be equal to this number, unless the server has fewer records to return. Note that this can be -1 to indicate that all records should be returned (although that negates any benefits of server-side processing!)
- 
draw: 
 
- class flask_datatables.typing.Response[source]¶
 Bases:
TypedDictReturned data.
Once DataTables has made a request for data, with the above parameters sent to the server, it expects JSON data to be returned to it, with the following parameters set.
- 
data: 
List[Union[List[Any],ObjectData]]¶ The data to be displayed in the table. This is an array of data source objects, one for each row, which will be used by DataTables. Note that this parameter’s name can be changed using the
ajaxoption’sdataSrcproperty.
- 
draw: 
int¶ The draw counter that this object is a response to - from the
drawparameter sent as part of the data request. Note that it is strongly recommended for security reasons that you cast this parameter to an integer, rather than simply echoing back to the client what it sent in thedrawparameter, in order to prevent Cross Site Scripting (XSS) attacks.
- 
error: 
Optional[str]¶ If an error occurs during the running of the server-side processing script, you can inform the user of this error by passing back the error message to be displayed using this parameter. Do not include if there is no error.
- Type:
 Optional
- 
data: 
 
- class flask_datatables.typing.Search[source]¶
 Bases:
TypedDictSearch information.
- 
regex: 
bool¶ Trueif the global filter should be treated as a regular expression for advanced searching,Falseotherwise. Note that normally server-side processing scripts will not perform regular expression searching for performance reasons on large data sets, but it is technically possible and at the discretion of your script.
- 
regex: