Skip to content

support shift+click on server-process mode#481

Merged
yihui merged 1 commit intorstudio:masterfrom
shrektan:shift-sel-server
Jan 18, 2018
Merged

support shift+click on server-process mode#481
yihui merged 1 commit intorstudio:masterfrom
shrektan:shift-sel-server

Conversation

@shrektan
Copy link
Copy Markdown
Collaborator

closes #305 again

@shrektan
Copy link
Copy Markdown
Collaborator Author

还是这个例子,目测没有问题:

library(shiny)

server <- function(input, output) {
  output$data <- DT::renderDT(
    DT::datatable(iris), server = T
  )
  output$data_sel <- renderText(input$data_rows_selected)
}
ui <- fluidPage(
  tagList(
    DT::DTOutput("data"),
    textOutput("data_sel")
  )
)

shinyApp(ui, server, options = list(port = 7995))

@yihui
Copy link
Copy Markdown
Contributor

yihui commented Jan 17, 2018

超级棒!目测貌似确实没啥问题,我合并了之后得清理一下代码,好像有一些冗余的复制粘贴可以合并在一起。多谢!

@yihui yihui mentioned this pull request Jan 17, 2018
3 tasks
@shrektan
Copy link
Copy Markdown
Collaborator Author

不好意思,我没看见你回复, force push 了。。

return server ? DT_rows_current[clientRowIndex] : clientRowIndex + 1;
}

var flagServerShiftSel = function() {
Copy link
Copy Markdown
Collaborator Author

@shrektan shrektan Jan 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这改成了函数,感觉会更安全些。

@yihui
Copy link
Copy Markdown
Contributor

yihui commented Jan 17, 2018

没事,我还没看完,所以还没合并。

@shrektan
Copy link
Copy Markdown
Collaborator Author

嗯嗯,不客气啦,还蛮有意思~

Copy link
Copy Markdown
Contributor

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

终于大致看完了,谢谢。合并之后我再微调一下。

@yihui yihui added this to the v0.3 milestone Jan 18, 2018
@yihui yihui merged commit e9785bc into rstudio:master Jan 18, 2018
@yihui
Copy link
Copy Markdown
Contributor

yihui commented Jan 18, 2018

好了,我改完了。除了 ab19b59 我不是百分百确定之外,剩下的改动应该是有谱的。

@shrektan
Copy link
Copy Markdown
Collaborator Author

shrektan commented Jan 18, 2018

昨天睡太晚,感觉脑子不太清醒,回去再看看 ab19b59 , 可能加上 d1f7ae2 后就不需要了, 其他改动应该都没问题,comment写的很详细,学习啦,下次努力减小你的负担,哈哈。

@shrektan
Copy link
Copy Markdown
Collaborator Author

确认flagServerShiftSel() 是多余的,当时可能头晕了,想的是selected1在前面的逻辑已经定义完毕了,其他地方不应该对它进行改动 😦

@yihui
Copy link
Copy Markdown
Contributor

yihui commented Jan 18, 2018

好的,那 0.3 版本马上就要完工了,我都两年没更新这个包了……

@shrektan
Copy link
Copy Markdown
Collaborator Author

哈哈,DT还算比较完善啦,基本功能都蛮好用。

话说回来,你那天发邮件给我,点燃了我鼓捣代码的激情,上周六一鼓作气,竟然自己解决了data.table这个包,在Windows上,困扰了我两年的中文支持bug。哈哈哈,开心死了,Rdatatable/data.table#2566

@yihui
Copy link
Copy Markdown
Contributor

yihui commented Jan 19, 2018

恭喜恭喜!我是首席鼓励官

把你这个答案稍微展开一下然后我给你打个赏:https://stackoverflow.com/a/48306226/559676

@shrektan
Copy link
Copy Markdown
Collaborator Author

哈哈,首席鼓励官名副其实~

土了,啥是打赏,当时为了提这个问题,特意注册的Stackoverflow的账号(平时都是匿名在上面看答案 🐍 )… 最近倒是有打算用blogdown把博客重新开起来,欢迎捧场 ~ 🍻

@yihui
Copy link
Copy Markdown
Contributor

yihui commented Jan 19, 2018

打赏就是你回答问题,我送你积分:https://yihui.name/en/2017/12/so-bounties/

博客赶紧开开开,我一般不跟没有个人网站的人说话。

@shrektan
Copy link
Copy Markdown
Collaborator Author

@yihui 最近太忙,博客建好了,选了半天主题,最后还是觉得你的X-Min最顺眼,哈哈~~ 等有空的时候微调下~~

https://stackoverflow.com/questions/47599934/why-doesnt-r-data-table-support-well-for-non-ascii-keys-on-windows/48306226#48306226 我展开了下下,希望达到了打赏的要求,:stuck_out_tongue_winking_eye: :moneybag: :moneybag:。

@shrektan shrektan deleted the shift-sel-server branch January 31, 2018 18:43
@yihui
Copy link
Copy Markdown
Contributor

yihui commented Jan 31, 2018

好好好!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Selecting multiple rows using shift+click

2 participants