Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
Shiny DT lock some columns AND rows for editing

What I want is that only certain cells are editable by the user, for example in the iris dataset I want the first 3 rows to be locked and also the second and the third column.

I have found the same question here on SO (Shiny datatable mode editable - restrict specific columns AND ROWS), however unfortunately the provided solution does not work (as there only the columns get locked after running the code). Here is a minimal reprex.

as you can see I wrote both the respective columns and rows in the argument, however only the columns got locked.

library(shiny)

library(DT)


ui <- fluidPage(
  DTOutput("table")
)

dat <- iris[1:10, ]

server <- function(input, output, session){
  
  output$table <- renderDT({
    datatable(dat, editable = list(target='cell', disable = list(columns = c(2:3), rows=c(1:3) )))
  }, server = FALSE)
  

  
}

shinyApp(ui, server)
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!