Comments (6)
Our great helper @mikmart has made it again! Now you can try the development version:
remotes::install_github('rstudio/DT')
from dt.
I can confirm it works! Thank you so much @mikmart , you're on a roll!!
from dt.
I'm not sure what you meant by "It repeats the row header for each row (even when the grouping column has the same value)". Here is my minimal reprex:
d = data.frame(
Group = rep(xfun::n2w(1:3), length.out = 26),
a = sample(26), b = letters, c = factor(rep(c('a', 'b'), 13)),
d = Sys.Date() + 1:26, e = Sys.time() + 1000 * (1:26), row.names = LETTERS
)
DT::datatable(
d, rownames = FALSE,
options = list(rowGroup = list(dataSrc = 0), order = list(list(0, 'asc'))),
extensions = 'RowGroup'
)
DT::datatable(
d, rownames = TRUE,
options = list(rowGroup = list(dataSrc = 1), order = list(list(1, 'asc'))),
extensions = 'RowGroup'
)
rownames = FALSE
rownames = TRUE
from dt.
Sorry that was poor triaging on my part. There is no issue with rownames
. The actual issue is with colReorder
and rowGroup
it seems. Here is a reproducible example:
renderDT({
datatable(setDT(data.frame(A=c(1,2,3,4),B=c(5,6,7,8),G=c("a","a","b","b"))), rownames=FALSE,
options = list(
colReorder = TRUE,
rowGroup = list(dataSrc = 2)
),
extensions = c("ColReorder", "RowGroup")
)
}, server=TRUE)
Initially the table is row-grouped by G
. When you move column A
(or any column) to the place where column G
was, and sort by that column, the row-grouping changes to that column, for example:
from dt.
d = data.frame(
A = c(1, 2, 3, 4),
B = c(5, 6, 7, 8),
G = c("a", "a", "b", "b")
)
DT::datatable(
d, rownames = FALSE,
options = list(
colReorder = TRUE,
rowGroup = list(dataSrc = 2)
),
extensions = c("ColReorder", "RowGroup")
)
Okay, I see the problem now. Technically it shouldn't be too difficult to fix. We need to reset the dataSrc
attribute for the rowGroup
extension in the column-reorder
event:
- https://datatables.net/reference/event/column-reorder
- https://datatables.net/reference/api/rowGroup().dataSrc()
I'm not sure if anyone wants to help. I don't have time to work on it at the moment, but can take another look in a couple of months if no one sends a PR.
from dt.
Great, thanks for testing!
from dt.
Related Issues (20)
- datatable column filters clash with shiny::selectizeInput when invoked first HOT 4
- DateTime date picker CSS is broken in SearchBuilder
- Disabling editable table by row (and not just by column) HOT 1
- autoFill extension returns `NaN` instead of incrementing HOT 5
- Docs do not state whether shift+click works for multi-row selection
- #828 breaks maintaining selected columns upon re-render HOT 3
- signif() + datatable() bug HOT 3
- `renderDT()` evaluates `...` in `expr`'s `env`
- Unable to test `renderDT()` in a `MockShinySession`
- First option entry ignored for default search values per column HOT 3
- "locked" proxy structure not accommodating new data HOT 4
- Extract search functionality
- upgrade to datatables v2 HOT 2
- R Shiny application designed to navigate through multiple sections within a single page
- Utilizing Scroller DataTable extension with `datatable(fillContainer = TRUE, ...)`
- Enable percentBar plugin HOT 5
- Upgrade DataTables to v1.13.11 HOT 2
- Interaction between searching options parameter and `datatable::filter` HOT 2
- Possible bug: styleRow() appears to do nothing when viewed in browser
- Low text contrast with pkgdown dark theme HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dt.