I need a table with selectable rows (there is a check box in every
row). All selected rows should be displayed with different style than
rows which are not selected.
I implemented this behavior by assigning the css-defined class to
tag
class="unchecked_msg">
and toggling the class whenever checkbox is clicked.
It works fine until user refreshes page. After the refresh checkbox is
still checked, but the class of the row is reset to “unchecked_msg”.
Anyone has an idea how to survive page refresh?
only way: make an ajax call, whenever the checkbox is clicked.
in the backend store the new value in the session or database
and use this information to rebuild the whole page for a refresh
It works fine until user refreshes page. After the refresh checkbox is
still checked, but the class of the row is reset to “unchecked_msg”.
Anyone has an idea how to survive page refresh?
Instead of hard-coding the classes write a dom:loaded observer in
JavaScript that iterates over the rows and assigns the class as
needed.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.