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
*[toolbar](https://bootstrap-table.com/docs/extensions/toolbar/) with [advanced-search](https://bootstrap-table.com/docs/extensions/toolbar/#advancedsearch)
45
-
* more in progress...
46
46
47
-
*server-side
47
+
48
48
49
49
## Installation
50
50
@@ -592,6 +592,11 @@ Table Dataset are provided directly to the `bootstrap-table` as data-attributes
Sometimes you don't want to display all the data in a database table. For this you can "prefilter" the Doctrine query.
738
745
739
-
### Example
746
+
#### Example
740
747
741
748
```php
742
749
/**
@@ -763,11 +770,53 @@ public function index(Request $request, HelloBootstrapTableFactory $tableFactory
763
770
}
764
771
```
765
772
773
+
### Detail View
774
+
775
+
You can expand rows in bootstrap-table. This option is called "detail view" and can be enabled in the datasets (by default this is disabled). For displaying the content of detail-view a formatter is needed (also to be specified in datasets). In the formatter you have access to the data of the table row. For complex representations Twig can also be used. See the example below.
776
+
777
+
```php
778
+
protected function buildColumns(ColumnBuilder $builder, $options)
779
+
{
780
+
//enable detail-view and set formatter
781
+
$this->setTableDataset(array(
782
+
'detail-view' => true,
783
+
'detail-formatter' => 'detailViewFormatter'
784
+
));
785
+
786
+
$builder
787
+
// other columns ...
788
+
789
+
// detailView is not a database field and can be named as you like.
790
+
// but the column should not displayed in the table (HiddenColumn)
791
+
->add('detailView', HiddenColumn::class, array(
792
+
// override data callback (as attribute you can access the entity that you specified in getEntityClass())
793
+
'data' => function (User $user) {
794
+
// now you can return everthing you want (twig render included)
To display `detailView` as content of the expanded table row a formatter function must be created and `detailView` must be returned. Remember to create the formatter before calling `{{ hello_bootstrap_table_js() }}`.
0 commit comments