Skip to content

Commit 138db47

Browse files
committed
Get DataTables dependency at run-time instead of build-time
1 parent 664b2b8 commit 138db47

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

‎R/output-datatable.R‎

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
dataTableDependency <- list(
2-
htmlDependency(
3-
"datatables", "1.10.2",
4-
c(file = system.file("www/datatables", package = "shinybootstrap2")),
5-
script = "js/jquery.dataTables.min.js"
6-
),
7-
htmlDependency(
8-
"datatables-bootstrap", "1.10.2",
9-
c(file = system.file("www/datatables", package = "shinybootstrap2")),
10-
stylesheet = c("css/dataTables.bootstrap.css", "css/dataTables.extra.css"),
11-
script = "js/dataTables.bootstrap.js"
1+
dataTableDependency <- function() {
2+
list(
3+
htmlDependency(
4+
"datatables", "1.10.2",
5+
c(file = system.file("www/datatables", package = "shinybootstrap2")),
6+
script = "js/jquery.dataTables.min.js"
7+
),
8+
htmlDependency(
9+
"datatables-bootstrap", "1.10.2",
10+
c(file = system.file("www/datatables", package = "shinybootstrap2")),
11+
stylesheet = c("css/dataTables.bootstrap.css", "css/dataTables.extra.css"),
12+
script = "js/dataTables.bootstrap.js"
13+
)
1214
)
13-
)
15+
}
1416

1517
#' Create a table output element
1618
#'
@@ -38,6 +40,6 @@ dataTableDependency <- list(
3840
dataTableOutput <- function(outputId) {
3941
attachDependencies(
4042
div(id = outputId, class="shiny-datatable-output"),
41-
dataTableDependency
43+
dataTableDependency()
4244
)
4345
}

0 commit comments

Comments
 (0)