Skip to content Skip to sidebar Skip to footer

Passing Params From Within To Action Specified In Createlink Within A Javascript Function, Called On Clicking Link

I have a template containing a g:each that renders a set of search results in tabular format as follows:

Solution 1:

Change your a tag like this:

<a href="javascript:void(0)" onClick="javascript:asd('${PNo.tdcId}', '${PNo.companyId}', '${PNo.companyType}');">${PNo.officialName}</a>

And Script like this:

<script>functionasd(tdcId, companyId, companyType) {
   var link = "${g.createLink(controller: 'test', action: 'test')}?tdc=" + tdcId + "&companyid=" + companyId + "&companytype=" + companyType;
   window.open(link, '', 'width=200,height=100');
}
</script>

Enjoy..

Post a Comment for "Passing Params From Within To Action Specified In Createlink Within A Javascript Function, Called On Clicking Link"