Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select field dynamic #370

Open
JohnCoene opened this issue May 8, 2024 · 0 comments
Open

Select field dynamic #370

JohnCoene opened this issue May 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JohnCoene
Copy link
Member

JohnCoene commented May 8, 2024

It looks like if the choices are dynamic then value must be dynamic too, in the example below the value default is not set to Species

test_block <- function(data, ...) {
  all_cols <- \(data) colnames(data)

  fields <- list(
    cols = new_select_field("Species", all_cols)
  )

  new_block(
    fields = fields,
    expr = quote({
      data[,.(cols)]
    }),
    ...,
    class = c("test_block", "transform_block")
  )
}

To make it work we'd have to use new_select_field(\(data) "Species", all_cols)

@JohnCoene JohnCoene added the bug Something isn't working label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant