From: Andrea Zagli Date: Mon, 2 Jan 2023 15:44:13 +0000 (+0100) Subject: Setting row template. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=71cc771f7e3a09076b7ff10dcc85b111314be97b;p=rust%2Fzakgrid Setting row template. --- diff --git a/src/lib.rs b/src/lib.rs index 5cf721a..8025e2a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,8 +67,8 @@ impl Grid { Grid { header_tmpl: String::from("\n{{ row }}\n"), header_row_tmpl: String::from("\t{{ title }}\n"), - row_tmpl: String::new(), - row_col_tmpl: String::new(), + row_tmpl: String::from("\n{{ row }}\n"), + row_col_tmpl: String::from("\t{{ value }}\n"), columns: vec![] } } @@ -81,6 +81,14 @@ impl Grid { self.header_row_tmpl = tmpl; } + pub fn set_row_tmpl(&mut self, tmpl: String) { + self.row_tmpl = tmpl; + } + + pub fn set_row_col_tmpl(&mut self, tmpl: String) { + self.row_col_tmpl = tmpl; + } + pub fn add_column(&mut self, col: Column) { self.columns.push(col); }