-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stefan Kuethe
committed
Sep 17, 2024
1 parent
e71ce6a
commit cf4169b
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: "Connecting tables" | ||
--- | ||
|
||
```{r, include = FALSE} | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>" | ||
) | ||
``` | ||
|
||
```{r setup} | ||
library(rtabulator) | ||
``` | ||
|
||
With the setup option `movable_rows_connected_tables` you can move rows between two or more tables: | ||
|
||
```{r} | ||
sender_df <- head(iris, 3) | ||
empty_df <- head(iris, 0) | ||
tab_sender <- tabulator( | ||
sender_df, | ||
tabulator_options( | ||
movable_rows = TRUE, | ||
movable_rows_connected_tables = "#table-receiver", | ||
movable_rows_receiver = "add", | ||
movable_rows_sender = "delete", | ||
placeholder = "All rows moved" | ||
), | ||
element_id = "table-sender" | ||
) | ||
tab_receiver <- tabulator( | ||
empty_df, | ||
tabulator_options( | ||
placeholder = "Drag rows here" | ||
), | ||
element_id = "table-receiver" | ||
) | ||
tab_sender | ||
tab_receiver | ||
``` | ||
|
||
*** | ||
|
||
**Note** | ||
|
||
In some browsers _moving rows functionality_ does not seem to work at the moment. | ||
|
||
*** |