Saving modified rows
Saving modified rows
burntsausage
Posts: 9Questions: 0Answers: 0
Hi.
I'm using the wonderful datatables plugin to sort/paginate on the front-end after reading data from a java back-end. The html table rows are added as they iterate over the data set.
Problems arise when there are more rows in the table than are set to display.
So if there are 10 rows showing per page, but 12 rows in the table and I click my save button, the java can't see all the rows it's expecting so it errors.
If I increase the displayed rows to 20 for example, it's fine as all the rows are visible and the back-end process is happy.
I inititally thought that datatables worked by hiding all the rows not being displayed on the page (which would be fine), but realise now that the data is stored in an array and only called when required.
Am I mis-using datables? Any ideas?!
I'm using the wonderful datatables plugin to sort/paginate on the front-end after reading data from a java back-end. The html table rows are added as they iterate over the data set.
Problems arise when there are more rows in the table than are set to display.
So if there are 10 rows showing per page, but 12 rows in the table and I click my save button, the java can't see all the rows it's expecting so it errors.
If I increase the displayed rows to 20 for example, it's fine as all the rows are visible and the back-end process is happy.
I inititally thought that datatables worked by hiding all the rows not being displayed on the page (which would be fine), but realise now that the data is stored in an array and only called when required.
Am I mis-using datables? Any ideas?!
This discussion has been closed.
Replies
This is correct.
Any changes you are caching can go off the page. You'll need to work out a way to preserve that info if you intend to submit changes that are off the page.
One solution (although not very elegant) is to trigger the table to output all the rows by dynamically changing the rows per page on clicking the Save/submit button.
if there are loads of rows, maybe hide them with CSS while they save, then change the rows per page back to what it was originally.
Just as a side note, we are using ADF here which makes life very difficult when trying to customise the way things are done in the back-end!