You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/index.html.md
+40-27Lines changed: 40 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,56 +148,69 @@ datatables:
148
148
translation_domain: messages
149
149
```
150
150
151
-
Global configuration of the bundle is done in your config file. The default configuration is shown here,
151
+
Global configuration of the bundle is done in your Symfony config file. The default configuration is shown here,
152
152
and should be fine in most cases. Most settings can be overridden per table, but for most applications
153
153
you will want to make changes at the global level so they are applied everywhere, providing a uniform
154
154
look and feel.
155
155
156
-
The following settings only exist at the configuration level:
156
+
The following settings exist at the configuration level:
157
157
158
158
Option | Type | Description
159
159
------ | ---- | ------- | -----------
160
+
language_from_cdn | bool | Load i18n files from DataTables CDN or from Symfony Translations.
161
+
options | object | Default options that will be passed to DataTables clientside initialization.
162
+
method | string | Either `GET` or `POST` to indicate which HTTP method to use for callbacks.
163
+
renderer | string | Service used to render the table HTML, which must implement the <code>DataTableRendererInterface</code>.
160
164
template | string | Default template to be used for rendering the basic HTML table in your templates.
161
-
renderer | string | Service used to render the table HTML, which must implement the <code>DataTableRendererInterface</code>.
165
+
template_parameters | object | Default parameters to be passed to the template during rendering.
166
+
translation_domains | string | Default Symfony Translation Domain used where translations are used.
162
167
163
-
The other settings correspond to table level settings, and the `options` are passed (almost) verbatim
164
-
to the DataTables clientside constructor. Refer to the sections below for details on individual settings
165
-
and options.
168
+
All settings can be overridden on individual tables by calling the corresponding setter function,
169
+
ie. `setLanguageFromCDN(bool)`.
166
170
167
-
## Settings
171
+
The `options` are passed (almost) verbatim to the DataTables clientside constructor. Refer to the
172
+
[external documentation](https://datatables.net/reference/option/) below for details on individual
173
+
options. Only options which are meaningful to be defined serverside can be set at this level, so
174
+
setting callbacks and events is not possible. These are however easily set on the Javascript end.
168
175
169
-
These settings can all be defined both at the global config level and overridden per table.
176
+
# Core concepts
170
177
171
-
Setting | Type | Default | Description
172
-
------- | ---- | ------- | -----------
173
-
name | string | dt | The name of the DataTable. Used mainly to separate callbacks in case multiple tables are used on the same page.
174
-
method | string | POST | Use `GET` or `POST` to define the HTTP method used by callbacks.
175
-
class_name | string | | Class to apply to the `<table>` element in generated tables. Separate multiple classes with a space.
176
-
column_filter | string | *null* | When using column level filters set this to `thead`, `tfoot` or `both` to specify where to render them.
177
-
language_from_cdn | bool | true | Either loads DataTables' own translations from CDN (default) or have them provided by your own Symfony translation files.
178
-
translation_domain | string | messages | Default translation domain used in the table structure.
178
+
This chapter details various base building blocks used in the bundle.
179
179
180
-
## Options
180
+
## Adapters
181
181
182
-
# Core concepts
182
+
Adapters are the core elements bridging DataTables functionality to their underlying data source.
183
+
Popular implementations for common data sources are provided, and more are welcomed.
183
184
184
-
## DataTable types
185
+
An adapter is called by the bundle when a request for data has been formulated, including search
186
+
and sorting criteria, and returns a result set with metadata on record counts.
185
187
186
-
Having the table configuration in your controller is convenient, but not practical for reusable or
187
-
extensible tables, or highly customized tables.
188
+
## Columns
188
189
189
-
In the example above we could also create a class `DataTable\Type\PresidentsTableType` in our app bundle,
190
-
and make it implement `Omines\DataTablesBundle\DataTableTypeInterface`. We can then use:
190
+
Column classes derive from `AbstractColumn`, and implement the transformations required to convert
191
+
raw data into output ready for rendering in a DataTable.
0 commit comments