|
@@ -28,11 +28,11 @@ impl GroupAction for CheckboxGroupController {
|
|
|
}
|
|
|
|
|
|
fn can_group(&self, content: &str, cell_data: &Self::CellDataType) -> bool {
|
|
|
- return if cell_data.is_check() {
|
|
|
+ if cell_data.is_check() {
|
|
|
content == CHECK
|
|
|
} else {
|
|
|
content == UNCHECK
|
|
|
- };
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
fn add_row_if_match(&mut self, row_rev: &RowRevision, cell_data: &Self::CellDataType) -> Vec<GroupChangesetPB> {
|
|
@@ -46,11 +46,9 @@ impl GroupAction for CheckboxGroupController {
|
|
|
changeset.inserted_rows.push(InsertedRowPB::new(row_pb.clone()));
|
|
|
group.add_row(row_pb);
|
|
|
}
|
|
|
- } else {
|
|
|
- if is_contained {
|
|
|
- changeset.deleted_rows.push(row_rev.id.clone());
|
|
|
- group.remove_row(&row_rev.id);
|
|
|
- }
|
|
|
+ } else if is_contained {
|
|
|
+ changeset.deleted_rows.push(row_rev.id.clone());
|
|
|
+ group.remove_row(&row_rev.id);
|
|
|
}
|
|
|
if !changeset.is_empty() {
|
|
|
changesets.push(changeset);
|
|
@@ -97,6 +95,12 @@ impl GroupController for CheckboxGroupController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ fn did_create_row(&mut self, row_pb: &RowPB, group_id: &str) {
|
|
|
+ if let Some(group) = self.group_ctx.get_mut_group(group_id) {
|
|
|
+ group.add_row(row_pb.clone())
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
pub struct CheckboxGroupGenerator();
|