Last active
May 24, 2016 21:57
-
-
Save mguillermin/5619197 to your computer and use it in GitHub Desktop.
Submitting Ajax POST with PlayFramework 2.x and the Javascript Router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
_nS('controllers.admin.Products'); _root.controllers.admin.Products.search = | |
function() { | |
return _wA({method:"POST", url:"/" + "admin/product/search"}) | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@helper.javascriptRouter("jsRoutes")( | |
controllers.admin.routes.javascript.Products.search | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jsRoutes.controllers.admin.Products.search().ajax({ | |
data: $("#product-search-form").serialize(), | |
success: function(data) { | |
$("#results").html(data); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /admin/product/search controllers.admin.Products.search() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment