File tree Expand file tree Collapse file tree 2 files changed +3
-24
lines changed
examples/invoice/src/components Expand file tree Collapse file tree 2 files changed +3
-24
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,8 @@ use crate::js;
1313use crate :: state:: { Editing , State , Text } ;
1414
1515#[ component]
16- pub fn Cell (
17- col : usize ,
18- row : usize ,
19- state : & Hook < State > ,
20- generate_remove_row_id_for_row : impl Fn ( usize ) -> String ,
21- ) -> impl View + ' _ {
16+ pub fn Cell ( col : usize , row : usize , state : & Hook < State > ) -> impl View + ' _ {
2217 // debug!("Cell get_text source {:?} {:?}", col, row);
23- let id_to_destroy = generate_remove_row_id_for_row ( row) ;
2418 let value: & str ;
2519 if col <= ( state. details . table . columns . len ( ) - 1 ) {
2620 value = state
@@ -41,12 +35,6 @@ pub fn Cell(
4135 Ok ( r) => r,
4236 Err ( e) => return ,
4337 } ;
44- // TODO - we're not using the `row_id` to remove rows,
45- // so we can remove `generate_remove_row_id_for_row`
46- let row_id = match event. target ( ) . get_attribute ( "id" ) {
47- Some ( r) => r,
48- None => return ,
49- } ;
5038
5139 state. remove_row_main ( row_usize) ;
5240 } ) ;
@@ -103,7 +91,6 @@ pub fn Cell(
10391 <td. destroy-container>
10492 <button. destroy
10593 data={ row}
106- id={ id_to_destroy}
10794 onclick={ onremove_row}
10895 />
10996 </td>
@@ -139,7 +126,6 @@ pub fn Cell(
139126 <td. destroy-container>
140127 <button. destroy
141128 data={ row}
142- id={ id_to_destroy}
143129 onclick={ onremove_row}
144130 />
145131 </td>
@@ -162,7 +148,6 @@ pub fn Cell(
162148 <td. destroy-container>
163149 <button. destroy
164150 data={ row}
165- id={ id_to_destroy}
166151 onclick={ onremove_row}
167152 />
168153 </td>
Original file line number Diff line number Diff line change @@ -192,10 +192,6 @@ pub fn Editor() -> impl View {
192192 let process_row_value_for_label_for_table =
193193 |label : & str | -> String { get_row_value_for_label_for_table ( & label, & state) } ;
194194
195- let generate_remove_row_id_for_row = |row : usize | -> String {
196- return "destroy-main-" . to_string ( ) + & i32:: try_from ( row) . unwrap ( ) . to_string ( ) ;
197- } ;
198-
199195 view ! {
200196 <div . invoice-wrapper>
201197 <section . invoiceapp>
@@ -298,12 +294,10 @@ pub fn Editor() -> impl View {
298294 <tbody>
299295 {
300296 for state. main. table. rows( ) . map( move |row| view! {
301- <tr
302- id={ generate_remove_row_id_for_row( row) }
303- >
297+ <tr>
304298 {
305299 for state. main. table. columns( ) . map( move |col| view! {
306- <Cell { col} { row} { state} { generate_remove_row_id_for_row } />
300+ <Cell { col} { row} { state} />
307301 } )
308302 }
309303 </tr>
You can’t perform that action at this time.
0 commit comments