Do you need to edit some data in your webapplication? If you are building an R shiny app, you can use the Rhandsontable package for it. I have used it a couple of times now and though there are some points for improvement for this package, it could be a good solution for you. In this blog I will describe about an improvement I have made for this package: search functionality. Since I am making money by using the great (mostly free) products of the R community, I am glad to give something back!
- add a parameter to the rhandsontable constructor to indicate if searching should be allowed
- add a textfield where a user can enter text
- add an event handler that reads the data and updates the table
Please see my pull request for the code changes. The animated gif below shows a simple example of the search functionality. The data in the table is the life expectancy for all countries split by gender. To see quickly which countries belong to America, start typing in Americas. You will see that the match doesn’t need to be complete, if part of the search string matches with a cell, that cell will be highlighted.