ThomasSiegmund / D3TableFilter

A table widget based on Max Guglielmi's "HTML Table Filter Generator" and D3.js
Other
65 stars 17 forks source link

Accessing row data in Shiny #15

Closed JoshMB8 closed 7 years ago

JoshMB8 commented 7 years ago

Firstly loving this package, the filters and edit-ability are much better than other table packages I have come across.

Secondly this is more of a question than an issue. I apologise if the answer is obvious or that I've missed it in the documentation, I'm fairly new to both this package and using shiny.

How would I go about accessing the information of a D3Table in Shiny?

For example if you were to use the DT package in shiny you could get info as follows: in ui: dataTableOutput("x") in server: input$x_rows_selected This would return the row number, which you could use as an input for a function.

Similarly you can do the same with input$x_cell_clicked for the info within a specific cell.

So my question is is there an equivalent for this package as I am creating an app where once a row is selected the Row number is taken and entered into a function to create another table.

Thank you for the help.

ThomasSiegmund commented 7 years ago

Thanks for the comments.

For the row selection there is input$tableID_select, for edit events input$tableID_edit. Filtering can be observed in input$tableID_filter. See examples/interaction for example code.

Alternatively you can get the filtered rows using crosstalk. See examples/crosstalk.

Best

Thomas

JoshMB8 commented 7 years ago

Great thank you for the quick response.