-
Beta Was this translation helpful? Give feedback.
Answered by
MoNaEcho
Nov 13, 2025
Replies: 2 comments
-
|
You can do like this: struct MyTableDelegate {
parent: Entity<HelloWorld>,
}
struct HelloWorld {
checked_rows: Vec<bool>,
}
impl TableDelegate for MyTableDelegate {
fn render_td(
&self,
row_ix: usize,
col_ix: usize,
window: &mut Window,
cx: &mut App,
) -> impl IntoElement {
let MyData {
checked,
id,
name,
age,
email,
} = &self.data[row_ix];
let col = &self.columns[col_ix];
match col.key.as_ref() {
"checkbox" => div().child(
Checkbox::new("row_checkbox")
.checked(*checked)
.on_click(window.listener_for(&self.parent, HelloWorld::toggle_row_checked(row_ix))),
),
_ => div().child("".to_string()),
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
MoNaEcho
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


it work! thanks