35

I have a dataTable in Shiny but I want to disable sorting and get rid of the arrows next to the column headings as exemplified in the following image.

enter image description here

I have used the following code to attempt to disble it with no luck.

output$ex <-
  renderDataTable({inData},
                  options = list(
                      bLengthChange = 0,
                      bFilter       = 0,
                      bInfo         = 0,
                      bPaginate     = 0,
                      bSortable     = 0,
                      bOrderable    = 0),
                  rownames=FALSE)

I thought bSortable=0, bOrderable=0 would do the trick but doesn't make it work.

steveb
  • 5,382
  • 2
  • 27
  • 36
mike
  • 881
  • 2
  • 10
  • 23

1 Answers1

64

Try

datatable(iris,options = list(ordering=F))

to remove sorting

And

datatable(iris,options = list(dom='t',ordering=F))

to show only table

Batanichek
  • 7,761
  • 31
  • 49