]> saetta.ns0.it Git - libgdaexgrid/commitdiff
Html: take into account visible property.
authorAndrea Zagli <andrea.zagli@email.it>
Sun, 28 Mar 2021 18:28:41 +0000 (20:28 +0200)
committerAndrea Zagli <andrea.zagli@email.it>
Sun, 28 Mar 2021 18:28:41 +0000 (20:28 +0200)
src/grid.c

index ee5124cb3d3e4ac0b3ffd2844af7cccc6dbb08d3..e069bbe1063f7ed1e0c635b64e80be2f31f92e83 100644 (file)
@@ -1111,9 +1111,12 @@ gchar
        for (col = 0; col < priv->columns->len; col++)
                {
                        gcolumn = (GdaExGridColumn *)g_ptr_array_index (priv->columns, col);
-                       g_string_append_printf (str,
-                                               "\t%s\n",
-                                               gdaex_grid_html_column_get_header (gcolumn));
+                       if (gdaex_grid_column_get_visible (gcolumn))
+                               {
+                                       g_string_append_printf (str,
+                                                               "\t%s\n",
+                                                               gdaex_grid_html_column_get_header (gcolumn));
+                               }
                }
 
        g_string_append (str, "</tr>\n");
@@ -1236,19 +1239,22 @@ gchar
                                        g_value_init (&gval, G_TYPE_STRING);
 
                                        gdaex_col = (GdaExGridColumn *)g_ptr_array_index (priv->columns, col);
-                                       field_name = gdaex_grid_column_get_field_name (gdaex_col);
-
-                                       /* checking if field exists */
-                                       if (gda_data_model_get_column_index (dm, field_name) == -1)
-                                               {
-                                                       g_value_set_string (&gval, missing_func (dm_iter, gdaex_col, user_data));
-                                               }
-                                       else
+                                       if (gdaex_grid_column_get_visible (gdaex_col))
                                                {
-                                                       _set_gvalue_stringify_from_datamodel((GdaExGridColumn *)g_ptr_array_index (priv->columns, col), &gval, dm, dm_iter, field_name);
-                                               }
+                                                       field_name = gdaex_grid_column_get_field_name (gdaex_col);
+
+                                                       /* checking if field exists */
+                                                       if (gda_data_model_get_column_index (dm, field_name) == -1)
+                                                               {
+                                                                       g_value_set_string (&gval, missing_func (dm_iter, gdaex_col, user_data));
+                                                               }
+                                                       else
+                                                               {
+                                                                       _set_gvalue_stringify_from_datamodel((GdaExGridColumn *)g_ptr_array_index (priv->columns, col), &gval, dm, dm_iter, field_name);
+                                                               }
 
-                                       g_string_append_printf (str, "\t<td>%s</td>\n", g_value_get_string (&gval));
+                                                       g_string_append_printf (str, "\t<td>%s</td>\n", g_value_get_string (&gval));
+                                               }
                                }
 
                        g_string_append (str, "</tr>\n");