Saving modified rows

Saving modified rows

burntsausageburntsausage Posts: 9Questions: 0Answers: 0
edited September 2011 in General
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?!

Replies

  • burntsausageburntsausage Posts: 9Questions: 0Answers: 0
    :(
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    [quote]burntsausage said: but realise now that the data is stored in an array and only called when required[/quote]

    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.
  • burntsausageburntsausage Posts: 9Questions: 0Answers: 0
    Ok fbas, thanks for the response.

    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!
This discussion has been closed.