Skip to content

Instantly share code, notes, and snippets.

@dlfinis
Created June 3, 2015 21:26
Show Gist options
  • Save dlfinis/2dc0f7a6e49620a43e31 to your computer and use it in GitHub Desktop.
Save dlfinis/2dc0f7a6e49620a43e31 to your computer and use it in GitHub Desktop.
Change event of select menu by ajax laod the article content in a part of the page
$(function() {
$( "#listImages" )
.selectmenu();
$(""#listImages").on('selectmenuchange',function() {
var articleId=$(this).val();
var groupId= <%=themeDisplay.getScopeGroupId() %>;
var url= '<liferay-portlet:renderURL windowState="exclusive" portletName="56_INSTANCE_cam"> '+
'<liferay-portlet:param name="groupId" value="ScopeGroupID" />'+
' <portlet:param name="articleId" value="ArticleID" />'+
' </liferay-portlet:renderURL>';
url=url.replace("ScopeGroupID",groupId);
url=url.replace("ArticleID",articleId);
$.ajax({
url:url,
success:function(response){
$("#content").html(response);
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment