Skip to content

Commit

Permalink
Merge branch 'main' into pedro-issue-1052
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui authored Oct 4, 2023
2 parents f0ceaa6 + faba4fb commit 107f4bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: DT
Type: Package
Title: A Wrapper of the JavaScript Library 'DataTables'
Version: 0.29.2
Version: 0.29.3
Authors@R: c(
person("Yihui", "Xie", email = "[email protected]", role = c("aut", "cre")),
person("Joe", "Cheng", role = "aut"),
Expand Down
10 changes: 6 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

- Fixed a bug that when using `updateSearch()`, the clear button inside the input box doesn't show up, and the table doesn't update when the input is cleared (thanks, @DavidBlairs, #1082).

- Added support for list of booleans as input to the `class` argument at `DT::datatable()` when `style='bootstrap'`. In other words, you can now select the Bootstrap classes you want to use at `DT::datatable()` by using a list of booleans that select the classes you want to use. In the example below, we are producing a new HTML table that uses the `stripe` and `hover` Bootstrap classes:
- Added support for a list of Booleans as input to the `class` argument of `DT::datatable()` when `style = 'bootstrap'` (thanks, @pedropark99, #1089). In other words, you can now select the Bootstrap classes you want to use at `DT::datatable()` by using a list of Booleans that select the classes you want to use. In the example below, we are producing an HTML table that uses the `stripe` and `hover` Bootstrap classes:

```r
DT::datatable(mtcars, class=list(stripe=T, compact=F, hover=T), style = "bootstrap")
```
```r
DT::datatable(mtcars, class = list(stripe = TRUE, compact = FALSE, hover = TRUE), style = "bootstrap")
```

- Handle `NULL` return from `bslib::theme_version()` (thanks, @slodge-work, #1090).

# CHANGES IN DT VERSION 0.29

Expand Down
1 change: 1 addition & 0 deletions R/datatables.R
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ normalizeStyle = function(style) {
}

bs_v = as.numeric(bslib::theme_version(theme)[1])
if (length(bs_v) == 0) return('default')
# TODO: If DT adds support for BS > 5, update this logic
if (bs_v > 5) bs_v = 5
style = paste0("bootstrap", if (bs_v > 3) bs_v)
Expand Down

0 comments on commit 107f4bf

Please sign in to comment.