event.source.columnAttributesData getting wrong dataset

I’m running the same window with
system.nav.openWindowInstance(‘EditTable’, {‘Table’ : ‘Invoices’, ‘Key’ : ‘Id’})

I always get the data from the original table from the designer. not the new dataset from the Invoices. The table Component shows the correct table, SELECT * FROM {Root Container.Table}

but event.source.columnAttributesData has a different set of columns.

Are you saying that your ‘SELECT * FROM {Root Container.Table}’ is never running? If you type ‘Invoices’ into Table the property on the root container, does it work? Do you have that Table property bound to something?

The .columnAttributesData property should have a very different dataset than the Data property of a table, and it won’t remember your changes across multiple datasets as it gets overwritten each time you change it.

yes the table is updating with the new sql table data.

I can’t access the properties of the columns in the table. the columnAttributesData doesn’t update when the new table is displayed.

The columnAttributesData set normally only updates in the designer. I think in this case, if you have just a few possible tables, you should have multiple table components and show/hide them based on the ‘Table’ dynamic property value.

If you have many possible values for your table name, then you might want to do as much column formatting as possible in the SQL query. Ie: using the ‘as’ operator to rename columns, and format dates using CONVERT() or DATE_FORMAT()

1 Like