mercredi 27 avril 2016

Bootstrap control for ordering

My google-fu failed to help me, there is may be an answer but I didn't find it.

I have a list with some data. Now I want user to be able to sort this list, so there should be several checkboxes with 3 possible states: ascending, descending or empty. States are cyclic Empty -> Descending -> Ascending -> Empty -> ... and should change by click.

I didn't write any markup yet, because I hope there is some standard control for it, but only found fa-sort-asc and fa-sort-desc arrows to customize div. I know I can create a custom div, write my custom logic to change states etc, but I still hope that some standard control which handles this feature exists.


Maybe I wrote something unclear or even wrong.

User do not perform sort itself. It just set some state (column1 asc, column2 desc) and then send a request to server (please, give me some records with those sorting rules). Then server does something, but it doesn't matter for us.

The problem is: how to set a state on client. I want to get somehow some controls, that has 3 states and changes them on user click. Then when user clicks on send request button, my JS just serialize them into viewstate (checkbox1 toggled as asc, checkbox3 toggled as desc) and sends it on server with user data. I know how to write a JS, but I don't know if there is some control with this behaviour.

Again, client doesn't sort anything, it just set a sorting state for server.




Aucun commentaire:

Enregistrer un commentaire