Add,Edit,Delete rows dynamically
Add,Edit,Delete rows dynamically
blue16
Posts: 5Questions: 1Answers: 0
Hi, i need add, edit and delete rows dynamically on my datatable and i need pass the changes to server side for save data in my database, what is the best way for do this?
I use
boostrap 3.2.0
J2EE
thanks
This discussion has been closed.
Answers
Datatables Editor:
http://editor.datatables.net/examples/simple/simple.html
thanks, but i need add three rows every time and my datatable has different number of columns depends of case
example
I add 3 rows with 6 columns other case is add 3 rows with 10 columns
There is another option
Certainly - but you'll need to write some code for it. Do the insert, update , delete on your database with whatever data you require and then use the
ajax.reload()
method to reload the data for the DataTable. You'll need to write the form and Ajax code if you don't want to use Editor though.Allan
The next code add one row successfully, but I need to add 4 rows every time you select "New", and finally the changes will be reflected in the table
It's possible do this or
how do I control the button New for add the rows
Editor will not automatically insert more than 1 row at a time at the moment, If that is a requirement for Editor then you would need to have it submit the
create
data four times - one for each row. That can be done using thecreate()
,submit()
and thesubmitComplete
methods and event.Allan
i will use dataTables.js and my own code for do this functionality
thanks