Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ordering problem of the FrissIntroJSBasic package for various TabPanels in ShinyApp #10

Open
AhuPersonal opened this issue Jun 16, 2017 · 1 comment

Comments

@AhuPersonal
Copy link

AhuPersonal commented Jun 16, 2017

When there are some more Tabpanels in the ShinyApp, the help button makes the same presentation for all of them. Are there any parameters to pair the related Tabpanels with the correct elements in the help.csv?

@Hendjy
Copy link

Hendjy commented Jul 5, 2021

To solve this I used an observeEvent in server.R and create for each TabPanel a .csv file.

server.R

 # listen to the action button
observeEvent(input$startHelp,{
    
    # Index help data into right tab
    indTab <- names(helpData)==input$sidebarmenu
    
    initIntroJS(session, helpData[[names(helpData)[indTab]]])
    
})

Global.R

helpDir : Help directory where are all the .csv files

helpData <- loadHelpContent()

loadHelpContent <- function(helpDir){

helpFiles <- dir(helpDir,"csv")

helpNames <- lapply(helpFiles,function(x){substr(x,0,nchar(x)-4)})

helpData <- list()

nHelpFiles <- length(helpFiles)

if(nHelpFiles==0)
return(list())

for(i in 1:nHelpFiles){
helpFile <- paste0(helpDir,"/",helpFiles[i])

tmpHelpData <- read.csv2(helpFile,1,stringsAsFactors=FALSE)

helpData[[helpNames[[i]]]] <- tmpHelpData

}

return(helpData)

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

No branches or pull requests

2 participants