Git Product home page Git Product logo

Comments (9)

DillonHammill avatar DillonHammill commented on August 10, 2024 1

This doesn't look like a rhandsontable issue. I suspect that it has something to do with the JavaScript code that I added to allow the editing of row/column headers - for some reason it is not being invoked within the modalDialog window. Due to my limited JS knowledge, I will need to ask for some external help if we are going to get this to work properly.

I remember @timelyportfolio helped me to get this JS code working a while back (jrowen/rhandsontable#344). Unfortunately I don't know anyone else who may be able to figure this one out. @timelyportfolio any chance that you would you be able to take a look at this when you get time? The relevant code is in the dataEdit module: https://github.com/DillonHammill/DataEditR/blob/master/R/dataEdit.R

from dataeditr.

lgirola avatar lgirola commented on August 10, 2024

Hi,

I'm having issues with running rhandsontable from within a modal too.

When rhandsontable is rendered in a modal box, depending on the circumstance only a part of the table is rendered until the user clicks on the partially rendered table. Is this a bug, or am I using rhandsontable incorrectly? Please see super simple MWE code below. It renders the initial table just fine, but when the user makes a change to the table (for example inserting a row with data) and tries re-rendering it by clicking the "Show" action button, only part of the table is rendered until the user clicks on the table.

The first image below shows the rendered table when first invoking the app - looks good. The second image shows the rendered table after having inserted a row/data and then clicking "Show" -- I only get a partial rendering of the table until clicking on it, and then the complete table pops up (as it should have done after the "Show" click). The third images shows the completely and correctly rendered table after inserting a 3rd row, after clicking "Show", and after clicking on the partially rendered table.

library(shiny)
library(rhandsontable)

ui <- fluidPage(actionButton("show","Show"), 
                actionButton("reset","Reset"))

server <- function(input,output,session){

  dat <- reactiveVal(data.frame(x=runif(2),y=runif(2)))
  
  observeEvent(input$show,{showModal(modalDialog(rHandsontableOutput("hot")))})
  
  observeEvent(input$reset,dat(data.frame(x=runif(2),y=runif(2))))
  
  output$hot <- renderRHandsontable(rhandsontable(dat()))

  } # close Server

shinyApp(ui,server)

Image1
Image2
Image3

from dataeditr.

lgirola avatar lgirola commented on August 10, 2024

from dataeditr.

timelyportfolio avatar timelyportfolio commented on August 10, 2024

please see jrowen/rhandsontable#387 as a step toward a solution

from dataeditr.

DillonHammill avatar DillonHammill commented on August 10, 2024

Thanks so much for looking into this @timelyportfolio! Do you mind taking a look at the original issue as well (i.e. the row/column editing). I have done some additional testing and if I click on a column name I cannot edit it in the modal dialog, but if I close the dialog the cell for the column name that I wanted to edit appears (i.e. column headers shown in mainPage() rather than modal). Perhaps this is related to the z-index? Is there a way to increase it just for column and row headers?

I am happy to add you as a contributor to this project if you would be interested.

from dataeditr.

DillonHammill avatar DillonHammill commented on August 10, 2024

@timelyportfolio, I have tried increasing the z-index in the dataEdit module to 10000. If I do this the box to edit the column headers does appear, however I am unable to edit the text. Perhaps I need to up the z-index for other components as well?

'z-index:1000;' +

from dataeditr.

ShinyFabio avatar ShinyFabio commented on August 10, 2024

Hi Dillon, I saw this solution:

please see jrowen/rhandsontable#387 as a step toward a solution

Do I have to implement it in my code, or I have to wait a version of your package with this bugfix? Because, for example, if I use dataEditServer() and dataEditUI() to display the table, I don't have to use the renderRHandsontable() function.

from dataeditr.

DillonHammill avatar DillonHammill commented on August 10, 2024

@ShinyFabio, unfortunately this won't fix your original issue related to editing of column/row names in modal dialogs. As I mentioned above this is quite complicated and I have not yet been able to get it to work. You will also notice that the proposed solution does not work in all instances - I hope that a more permanent fix will come in the near future. For now, I think I will leave the code in DataEditR as is - I would recommend using a tabular design in your application if you need to display data on separate pages.

from dataeditr.

ShinyFabio avatar ShinyFabio commented on August 10, 2024

I tried also to set col_names = FALSE but when I click on a column name (for example to select the entire column) the problem is still there. We will hope for a fix !

from dataeditr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.