Open abalter opened 4 years ago
library(DT)
dtable <- datatable(iris[c(1,2,51,52,101,102),],
options = list(
mark = list(accuracy = "exactly")
)
)
dep1 <- htmltools::htmlDependency(
"datatables.mark", "2.0.1",
src = c(href = "https://cdn.datatables.net/plug-ins/1.10.19/features/mark.js"),
script = "datatables.mark.min.js")
dep2 <- htmltools::htmlDependency(
"jquery.mark", "8.11.1",
src = c(href = "https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1"),
script = "jquery.mark.min.js")
dtable$dependencies <- c(dtable$dependencies, list(dep1, dep2))
dtable
Is that an extension?
It's a plugin.
I was looking at the extensions directory for some guides for how make one. All the code is minimized.
Simple implementations are found in here and contained links:
https://stackoverflow.com/questions/36176442/highlight-search-result-in-datatables
There is also a dedicated plugin:
https://github.com/julmot/datatables.mark.js
What would be the approach to make this an extension for R-DT?