Add dynamically rows to Table using JS function

37 views
Skip to first unread message

Amine Salmen Rekik

unread,
Mar 27, 2014, 10:20:26 AM3/27/14
to nagare...@googlegroups.com
Hello,

I have a table that contains input fields in each row. The user should be able to add new row, edit existing values and delete rows.

When user clicks add button, I should execute a JS function that appends the new line into table and when he clicks the save button, I should send the form to server in order to update /add the entries.

My question is: when adding new field using JS function,  how can I assign it to the appropriate callback function.?

You find in the attachment file my proposition, you can remark that when you click the add button, a new filed is appended to the table, but when you click the save button, the added fields are not  appended to the list.




table2.py

Alain Poirier

unread,
Apr 1, 2014, 9:02:11 AM4/1/14
to nagare...@googlegroups.com
Hi,

Le 27 mars 2014 à 15:20, Amine Salmen Rekik <amine...@gmail.com> a écrit :

> Hello,
>
> I have a table that contains input fields in each row. The user should be able to add new row, edit existing values and delete rows.
>
> When user clicks add button, I should execute a JS function that appends the new line into table and when he clicks the save button, I should send the form to server in order to update /add the entries.
>
> My question is: when adding new field using JS function, how can I assign it to the appropriate callback function.?

Nagare is a server-side framework, not a client-side one (in its current
version). So the callbacks must be generated and registered on the server.

Then, the easiest way, in this 'table3.py’ example, is to let the ‘Delete’
and ‘Add’ actions be sent to the server and the full table be renderered.

> You find in the attachment file my proposition, you can remark that when you click the add button, a new filed is appended to the table, but when you click the save button, the added fields are not appended to the list.

Best regards,
Alain

table3.py

Amine Salmen Rekik

unread,
Apr 1, 2014, 9:13:59 AM4/1/14
to nagare...@googlegroups.com
Thanks, it's clear :-)
Reply all
Reply to author
Forward
0 new messages