You have to narrow down the code to just the relevant part, in this case, it would be as simple as one line of code
# This doesn't work
DT::datatable(iris, options = list(filter = 'top'))
And the solution would be
# This works
DT::datatable(iris, filter = 'top')