prev/next button a bit like on "editor", but on another page than table
prev/next button a bit like on "editor", but on another page than table
rlorentz
Posts: 11Questions: 0Answers: 0
When in a table and I click a row, I redirect the user to a new page with more information about the item on the clicked row.
I would like the user to be able to click a prev and a next button on this page to go back/forward on the original table-list.
Any ideas on how to achieve this?
I would like the user to be able to click a prev and a next button on this page to go back/forward on the original table-list.
Any ideas on how to achieve this?
This discussion has been closed.
Replies
Go to www.casainfo.net, and click on "latest ads". A table will appear. Click on one of the rows, and the mentioned page with information about item will appear. On this I have a "back to list" option along arrow right/left. Would like to be able to click the arrows and get to next/previous item in original table.
regards,
Roar Lorentzen
Allan
How do I access the localStorage to get the row above and below?
Roar
Allan
Roar
1. In the on click handler for your row, store the order of the data from the table in local storage
2. Use that saved local storage in your details page to provide the forwards / backwards navigation controls.
Allan
Is this something you could help with, and how much would it take in £/€?
Roar
Something like:
[code]
localStorage.setItem( 'navigation', JSON.stringify( table.fnGetColumnData(0) ) );
[/code]
would store the information from the first column in a local storage parameter, which could then be accessed else where.
Allan
Is there a way to store the "id" of each "tr" by use of the localStorage.setItem, and JSON.stringify?
Roar
Allan
I'll give this a try.
thanks,
Roar
Have sorted it out, but it seems table.fnGetNodes( ) is not up to date with the sorting?
If I do a sort on a column, and later do the fnGetNodes() it is not in correct order?
Roar
Allan
edit - Whoohoo - that was post 14'000 :-)
I tried this : var tableRows = slTable.$('tr', {'page': 'current'});, and I loop tableRows.
It seems to work.
But I get an error on sorting after I added this, but only on the last column of my table:
TypeError: p[(("string" + "-") + o[c][1])] is not a function
http://www.casainfo.net/js/jquery.dataTables.min.js
Line 84
Roar
Well, it might be something else causing this error, not sure when it turned up. any idea?
Strange, I can't remember doing any changes that should cause the sorting on price to fail.
I do use a plugin for this, but it has worked well. Only thing i did today was add another plugin to the file I have the number format plugin in, but I have removed this and restored the file. Still does not work.
Roar