I noticed this morning that i cannot set the id of a column of a datagrid anymore in the (beta) editor. This is most unfortunate since you need this id if you want to add a component programmatically to a particular column. (almost drove me mad this morning since i used the data_key and my components ended up in the first column, after going throught the docs I discovered you need the id and not the data_key, realised I would normally set them to the same value in the editor…)
Do you mean the HTML id of the element?
You can set that through the Javascript bridge, something like:
node = js.get_dom_node(component)
node.id = "whatever"
Where component
is the Anvil component you want to work with. That could be self
, self.whatever
, etc.
You can also do other things with the Javascript node that might eliminate the need for an id (such as add elements to it, etc, basically anything you can do through Javascript).
I’m on my cell now, but if I remember you should be able to find the column id in the columns
property.
I have used the column ids in the DataGridJson
component, but I don’t remember ever accessing the id from the ide.