🟦 Dynamic Table

dynTable1

This falls somewhere between an extension and a guide, but probably best placed here. Consider this to be helper blocks which can be used in a bigger app.

In essence, the following generates a dynamic table from a data list and uses @Kevinkun's dynamic components extension CompCreator to do it. It is based, and expands, upon @Ken's TableView extension.

8 Likes

Hi Tim, your aia runs well, can you make a version with :
columns width adapted according to the content

There would need to be limits. What if you had a very long text, that wouldn't look good, one would need to work out the logic of when fit to content did not apply. It seemed better to allow the developer to decide on column widths, based upon the data being used. The developer could always provide the user with a settings page to allow them to set the widths to their liking.

However, nothing to stop you from programming in dynamic column widths based upon content :+1:

can you suggest what I have to change ?

You will need to analyse the content for each column, based upon length or type, then use logic/blocks to set the column width based upon that analysis. You can then use the existing column width setting blocks to set each column.

Hi Tim, you are right, I did not notice that the rows height fits the length of the content (I had eliminate the clock), now I have restored it and it is ok.

How can I convert the project to new extension (CompCreator)

What do you mean ?

Your project uses DCLITE extension, @Kevinkun renamed it to CompCreator, II would like to update my project for future updates

It is the same. I used an updated version before Kevinkun changed the name. However you cannot update the former with the latter. You would need to load the CompCreator extension then change every single block that has DCLite to CompCreator.

that's what I'd like to avoid

When I have really nothing else to do, I may update the original :slight_smile:

I'm not asking for that, can I open the aix as a zip and make substitutions ?

Original now updated on my site.

You will have to load the new CompCreator extension to your project, and replace each DCLite entry with a CompCreator entry.

Did you test it ?

Glad to see someone is awake. Now fixed. :slight_smile:

I'm trying to insert new rows and new columns, for rows I'm using this block


But I don't know how to get selected column, cen you help me ?

Insert these to the original or updated list, then reload the list to the table.

My question is: when I clic on a cell the cell's row is rowedit, how can I get the cell's column ?

It should be the index of the component in the item of tableRows (see below - tbCol)

Thank you, it's ok