javascript - manipulating a Play controller parameter in a template -


in play app(java) have table different columns, if user clicks on title of each column, table sorted based on column. each time user clicks on it, sorting should change "asc" "desc" , vice versa.

i need solution this: each time user clicks on link, order changes "asc" "desc" , vice versa. , controller should called.

<a href="@routes.application.changeorder(order)">test</a> 

is possible write scala function inside template this? or how javascript?

you can use if-clause:

@if(order.equals("asc")){   <a href='@routes.application.changeorder("desc")'>test</a> } else{   <a href='@routes.application.changeorder("asc")'>test</a> } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -