[BETA-Designer] Columns DataGrid

  1. Maybe I’m just blind, but I can’t find the option to edit the columns of the data grid.
    There is only a way to add new column, but not to edit them.

  1. New columns repeating panel edition.

In the old designer:

In the new designer:

I can’t tell where the new 2 columns are to add the new components. In the old one I can see Manufacturer and Category columns. Now I can only copy paste the column IDs letters in order to put it in the right column.

In general I love the new designer :slight_smile:

You can click to select a column, and interact with it directly!

Peek 2023-10-04 18-23


As for your second question:

What are we looking for here? Is there a column in the old designer that’s not visible in the new one?

1 Like

Ok, thanks to your explanation I could locate the settings. I’m not using the auto_header (Custom data row panel instead), so I have to switch it on, do the edition and switch off again.
image

exactly, not visible in the new one.
2 columns: “Manufacturer” and “Category”. All other columns have some textboxes or labels.

Btw. is there a way to stop the designer from trying to load the data? It don’t work because there is serverside function fetching the data on main form with data grid and passing it to the repeating panel that use settings to populate the components

KeyError: asset_id
at AssetManager.AssetDevices.AssetDevicesRepeatin, line 31
called from AssetManager.AssetDevices.AssetDevicesRepeatin, line 21
class AssetDevicesRepeatin(AssetDevicesRepeatinTemplate):
  def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)
    self.settings()
    
  def settings(self):
    """row settings"""
    self.lb_table_col_1.text = self.item['asset_id']
    self.lb_table_col_2.text = self.item['name']
    self.lb_table_col_3.text = self.item['sub_type']
    #................................................

Try this:

from anvil.designer import in_designer

class AssetDevicesRepeatin(AssetDevicesRepeatinTemplate):
  def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)
    self.settings()
    
  def settings(self):
    """row settings"""
    if in_designer:
        self.lb_table_col_1.text = '<asset_id>'
        self.lb_table_col_2.text = '<name>'
        self.lb_table_col_3.text = '<sub_type>'
    else:
        self.lb_table_col_1.text = self.item['asset_id']
        self.lb_table_col_2.text = self.item['name']
        self.lb_table_col_3.text = self.item['sub_type']
2 Likes

If you have code that tries to load the data, you may be able to use in_designer to skip over that code. More information:

2 Likes