-2

I want to see only three records in each page of my dataTableOutput. I have set page length to (pageLength = 3) but it does not show 3 rows in my table. The code is as following:

server.r :

# display table
  output$responses <- DT::renderDataTable({
    (options = list(pageLength = 3))
    #update after submit is clicked
    input$submit
    #update after delete is clicked
    input$delete
    ReadData()
  }

ui.r :

 box(
      title = "KPIs", status = "primary", solidHeader = TRUE,
      collapsible = TRUE,
     DT::dataTableOutput("responses"), tags$hr()

    ))
4

1 回答 1

1

尝试

output$responses <- DT::renderDataTable({
    #update after submit is clicked
    input$submit
    #update after delete is clicked
    input$delete
    DT::datatable(ReadData(), options = list(pageLength=3))})
于 2015-11-23T07:41:32.540 回答