I got a problem where action would not redirect to another action with following code:
redirect(controller: "book", action: "list")
then i used following code in Javascript file to redirect to new page
function holidaydelete(a){
var sId = a
var yearr = $('#daa'+sId+'_year').val()
var month = $('#daa'+sId+'_month').val()
var day = $('#daa'+sId+'_day').val()
var date = yearr +"-"+ month +"-"+ day
${remoteFunction(controller: "att", action: "deleteHolidayDate", update: "", params:'{date: date, sId: sId}')}
//to redirect
var current = window.location.href;
var toSplit = 'pms/';
var splitLocation = current.split(toSplit)
var newLocationToLoad = splitLocation[0]+toSplit+'att/holidayDate';
window.location.href = newLocationToLoad
}
this may be helpful to you !!!
redirect(controller: "book", action: "list")
then i used following code in Javascript file to redirect to new page
function holidaydelete(a){
var sId = a
var yearr = $('#daa'+sId+'_year').val()
var month = $('#daa'+sId+'_month').val()
var day = $('#daa'+sId+'_day').val()
var date = yearr +"-"+ month +"-"+ day
${remoteFunction(controller: "att", action: "deleteHolidayDate", update: "", params:'{date: date, sId: sId}')}
//to redirect
var current = window.location.href;
var toSplit = 'pms/';
var splitLocation = current.split(toSplit)
var newLocationToLoad = splitLocation[0]+toSplit+'att/holidayDate';
window.location.href = newLocationToLoad
}
this may be helpful to you !!!
0 comments:
Post a Comment