Hi got the answer ..............................
If i use below code in gsp it is working
<g:set var="colnames" value="${new MyController().colnames()}" />
<script>
$(document).ready(function() {
...................
colNames="${colnames}"
....................
</script>
And i altered the controller like below
------------------------------------------
Class MyController
{
def colnames()
{
return "id,name".toString()
}
}
Same for coldetails also
Regards,
Nazeer