title: editable table with shinyTable and submitButton
body: <p>I have a <a href="https://github.com/trestletech/shinyTable" rel="nofollow">shinyTable</a> in a shiny app. It is editable, but because of a submitButton elsewhere in the app the edits are not saved until the button is pressed. If more than one change is made and the button is pressed only the last change is saved.</p>
  
  <p>My question is how can I get it to save all the changes that have been made ?
  Perhaps there is a way that I can get at the contents of the whole table in the UI so I can workaround ?
  Or would I be better off using shinysky or something else ?</p>
  
  <p>Below is a reproducible example based on an example from the package. You'll see that if you make 2 changes to the upper table and then press the button only the 2nd change gets copied to the lower table.</p>
  
  <pre><code>library(shiny)
  library(shinyTable)
  
  server &lt;- function(input, output, session) {
  
    rv &lt;- reactiveValues(cachedTbl = NULL)
  
    output$tbl &lt;- renderHtable({
      if (is.null(input$tbl)){
  
        #fill table with 0
        tbl &lt;- matrix(0, nrow=3, ncol=3)
  
        rv$cachedTbl &lt;&lt;- tbl
        print(tbl)
        return(tbl)
      } else{
        rv$cachedTbl &lt;&lt;- input$tbl
        print(input$tbl)
        return(input$tbl)
      }
    })  
  
    output$tblNonEdit &lt;- renderTable({
      rv$cachedTbl
    })    
  }
  
  
  ui &lt;- shinyUI(pageWithSidebar(
  
    headerPanel("Simple Shiny Table!"),
  
    sidebarPanel(
      helpText(HTML("A simple editable matrix with an update button.
                    Shows that only most recent change is saved. 
                    &lt;p&gt;Created using &lt;a href = \"http://github.com/trestletech/shinyTable\"&gt;shinyTable&lt;/a&gt;."))
    ),
  
    # Show the simple table
    mainPanel(
      #editable table
      htable("tbl"),
      #update button
      submitButton("apply table edits"),         
      #to show saved edits
      tableOutput("tblNonEdit")
    )
  ))
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>Thanks for your time.
  Andy</p>