1

First of all i am using play framework with scala, What i have to do is , using the data which i am getting with that function;

onClick: function(node) {

        if(!node) return;
       alert(node.id);
       var id = node.id;

      }

So what the question is how i can call the methods from controller with this id ? Since js is client-side but scala works with server-side , i need something creative. This is the function i need to call from my controller.

 def supertrack(id:Long) = Action {
}

1 Answer 1

2

I have just found out that i need use ScalaJavaScriptRouting in order to send a ajax request to the server.

For the documentation

http://www.playframework.com/documentation/2.1.1/ScalaJavascriptRouting

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.