rstudio/shiny — pull request #356 by yihui (2014-01-08 06:27:28+00:00)
Title: To be able to evaluate options passed to DataTables

This is an attempt to solve an FAQ about datatables: users are unable to pass JS functions from R. I added a new argument `evalOptions` that takes a vector of names, and evaluate these elements in the options.

An example:

```s
runApp(list(
ui = fluidPage(dataTableOutput('foo')),
server = function(input, output) {
output$foo = renderDataTable(
iris,
options = list(fnRowCallback = '
(function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
// Bold cells for those >= 5 in the first column
if (parseFloat(aData[0]) >= 5.0)
$("td:eq(0)", nRow).css("font-weight", "bold");
})'
),
evalOptions = 'fnRowCallback'
)
}
))
```

Thoughts? @jcheng5