Has add row disappeared in new table component? 🙄

It appears that the add row feature has been taken away (i can't think why this would be a good idea!!?) however......

Is there a way to manually code this?
I can see a way to add a custom button to the table - but I don't really know how to get this to add a row......

thanks, Neil

@maillme Yes, you can create a query to add a new row to. Assign the button you are talking about to call this query.

Here is query in GUI:

If you need more detailed instructions, feel free to ask clarifying questions.

Hi Sanya,

Thank you for your reply!
Actually - I had found this, but this will require me creating a form of sorts, to actually take the new data and insert it into the table, right?

I was rather hoping, that like the legacy table - you could have an 'in line' row for the new data... but it seems not, right?

like below:

thanks again, Neil

image

Sorry, I don't know about the old form, I'm new, but here you can customize the fields however you want, I'm just doing it and no form is needed.

You can set up you field as null, or copy some values from the active row(row, where you press the action button)

Hello, here is my workaround without need to insert to database when you add new row.

first. add a variable, eg tempState.
then, make the default tempState value to {table1Value:query1.data}

change the data source of table to {{tempState.data.Promotion_select}}

In the toolbar buttons add custom button, change icon to +, then add the event handler to that button.

tempState.setIn(["Promotion_select"],[...tempState.value.Promotion_select,{id: uuid.v1()}])

Hi @SanyaCLAUS, @AnsonHwang - thank you -

Actually, it's more that I liked /wanted a cleaner interface so that the user can provide data for the new row - without me having to create a modal, form etc - the old component was very clean. It created an in-line row.

The inserting of the new row into the database isn't really the issue.

thanks again for your reply,
Neil

2 Likes

Hi all! Just wanted to share that, yes, we did remove the add row functionality in the new table. We are tracking requests for a built in add row functionality, and it may be something we add back to the table in the future.

3 Likes

Please see the attached example. You can download the json file and then use the "Import app from JSON/ZIP" to use this working example. I would have written an explanation, but the solution is a bit complicated. I had to write 2 javascript queries and create 2 temp state variables. I also added a function to the toolbar (+) and a save action. I hope this helps!

Continuing the discussion from Has add row disappeared in new table component? :roll_eyes::

insertNewRowsInTableComponent.json (19.1 KB)

2 Likes

Hi there,

We've added back the 'add row' functionality (more info here)

1 Like