ThomasSiegmund / D3TableFilter

A table widget based on Max Guglielmi's "HTML Table Filter Generator" and D3.js
Other
65 stars 17 forks source link

custom_slc_options #6

Closed ghost closed 9 years ago

ghost commented 9 years ago

Is this customization from HTML table filter available for D3TableFilter?

ThomasSiegmund commented 9 years ago

All configuration options from html table filter should be available. Basically you only have to express the JavaScript objects as nested lists in R. D3TableFilter translates this into JSON objects using jsonlite and passes the configuration object to the table filter generator javascript.

The custom_slc_options example from the tablefiler doc (http://tablefilter.free.fr/doc.php) should read like this:

tableProps <- list(
  col_3 = "multiple",
  col_5 = "multiple",
  custom_slc_options = list(
    cols = list(3, 5),
    texts = list('', list('1500 - 2000','2000 - 5000','5000 - 15000','15000 - 25000')), 
    values = list(list('Perl','C++','Suite'), list('>=1500 && <=2000','>2000 && <=5000','>5000 &&  <=15000','>15000 && <=25000')),
    sorts = list(FALSE, FALSE)
  )
)
d3tf(df, tableProps = tableProps, ...)
ThomasSiegmund commented 9 years ago

Works.