Comments (5)
@GoodMorgon Thank you for reporting the issue. This was a side effect of adding get_selected_data
function. The input$table
is always triggered regardless the value is changed or selected. When the value is changed in the table excel_to_R(input$table)
would now give the entire table while upon selection it would give NULL
as there is no change in the table.
from excelr.
@Swechhya I think it is still breaking change in modified example
library(shiny)
library(excelR)
shinyApp(
ui = fluidPage(excelOutput("table")),
server = function(input, output, session) {
rv <- reactiveValues(
dt = head(iris)
)
output$table <- renderExcel(excelTable(data = rv$dt))
observeEvent(input$table,{
rv$dt <- excel_to_R(input$table)
})
}
)
Also, is it possible to turn off trigger for selection change if it is not necessary? I guess this might slow down & cause issues in shiny
from excelr.
@marciz I agree with you on that, we could add a parameter in excelTable
to specify if we want to get selected values and based on that we could turn on the trigger for selection. Also, with the current changes in this version you might want to check for NULL
before printing the table. Code will be something like this:
library(excelR)
shinyApp(
ui = fluidPage(excelOutput("table")),
server = function(input, output, session) {
rv <- reactiveValues(
dt = head(iris)
)
output$table <- renderExcel(excelTable(data = rv$dt))
observeEvent(input$table,{
table_val <- excel_to_R(input$table)
if(!is.null(table_val)){
rv$dt <- table_val
}
})
}
)
What do you think about this approach? We have to do this because we use Shiny.setInputValue
for both excel_to_R
and get_selected_data
.
As for turning off trigger for selection change I'll add getSelectedData
parameter in excelTable
function which on default would be FALSE
.
from excelr.
@Swechhya, I agree - parameter getSelectedData
sounds good.
I haven't looked at recent changes in details, but what if getSelectedData = TRUE
and I need to change the input data? Possible solution would be excel_to_R
to return something like list(data = ..., selectedData = ...)
from excelr.
@GoodMorgon @marciz the issue mentioned in this PR has been fixed in the latest development version. The excel_to_R
behaviour is as in the earlier versions. Feel free to open it if you think the issue still persists.
from excelr.
Related Issues (20)
- colnames are missing when download CSV file using "toolbar" add-in HOT 2
- Upgrade to JSpreadsheet v4 HOT 4
- strange behaviour on overwiting cells content HOT 3
- using excelR with images / resizing & shape changing HOT 3
- rename "excelR" package? :-) HOT 1
- changing cell content HOT 2
- can't see the picture in the table HOT 1
- inter-dependent pulldowns in excelr cells
- ExcelR Table Crashes in Shiny when Pressing Enter on Last Row HOT 1
- Error in getTableData: could not find function "getTableData" HOT 5
- How to change row headers HOT 1
- Input object not available on initial render HOT 2
- Quarto fails to render due to missing sizeInfo$height?
- Programatically update table style HOT 2
- Is it possible to freeze columns?
- Scrolling while selecting
- excel_to_R function does not work
- Footers HOT 1
- Remove Row Index from excelTable? HOT 3
- input object corresponding to renderExcel output not available. HOT 4
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 excelr.