support shift+click to select mutiple rows #475
Conversation
Here's my testing code. library(shiny)
server <- function(input, output) {
output$data <- DT::renderDT(
DT::datatable(iris), server = F
)
output$data_sel <- renderText(input$data_rows_selected)
}
ui <- fluidPage(
tagList(
DT::DTOutput("data"),
textOutput("data_sel")
)
)
shinyApp(ui, server, options = list(port = 7995))
|
Overall this looks great! We need to prevent the text selection when holding Shift. I'll merge it and see if I can change it (presumably using https://api.jquery.com/event.preventdefault/). |
I have fixed the text selection issue. The other thing is that this probably does not work in the server-processing mode (which is always tricky in DT)... |
Well, just confirm that there's indeed a small issue (not that small...), which is the selection range will be different between the server-processing mode and the client side mode.
In the client side mode, the row selection will be 1 to 20, while in the server-processing mode, it's 1, 16 to 20... |
You need to use the vector |
I guess I should be able to fix it based on your current code, some ideas on server-processing mode:
Will try to fix it tonight or tomorrow~ |
Sounds great! |
我的 0.3 版本计划的事项现在还剩下两项:https://github.com/rstudio/DT/issues?q=is%3Aopen+is%3Aissue+milestone%3Av0.3 我先做 #28 去了,你这个事项需要比较细心的考虑,所以你慢慢来不着急,下周之前能捣鼓出来最好,捣鼓不出来也没事。多谢! |
恩恩,白天上班没什么时间 昨天稍微鼓捣了下,要是没有幺蛾子的话,感觉应该可以弄出来。因为没有测试嘛,代码有无其他坏的影响,姑且只能由你来把关啦,哈哈哈。 |
嗯,我也只能用意念力在脑子里“测试”。 |
closes #305