update the "tree view" and the associated "Data Table" values based on the selection from a dropdown
Hi All,
I have a requirement to update the "tree view" and the associated "Data Table" values based on the selection from a dropdown.
I want to refresh the page after getting the updated values when selecting the dropdown list.
I am able to get the values from my controller and refresh the page by using "location.reload();". But while refreshing the page the drop down list value is again set to default one, hence I am again getting the previous page.
Please suggest me to resolve this problem.
I am using grails-1.3.6 and jquery-1.4.4 for development.
My code snippest:
$(function() {
$("select#groupList").change(function(){
alert("IN TREE BUTTON1");
$.post("/VACD_DEMO/groupOverview/overviewtest",{id: $(this).val(), ajax: 'false'}, function(j){
location.reload();
});
});
<
td
valign
=
"top"
width
=
"165px"
>
<
div
style
="
height
:
20px
;
font
:
12px Tahoma, Arial
;
border-bottom
:
solid 1px gray
;"
>
View:
<
g:select
name
=
"groupList"
from
=
"
${
glist
}
"
noSelection
=
"
${
['null':'All Groups']
}
"
id
=
"groupList"
style
=
" width: 124px;"
></
g:select
>
</
div
>
<
div
style
="
float
:
left
;
border
:
1px
;
overflow
:
scroll
;
height
:
380px
;
width
:
165px
;"
>
<
ul
id
=
"tree1"
>
<
g:each
id
=
"test"
in
=
"
${
tmap
}
"
status
=
"i"
var
=
"gvar"
>
<
input
type
=
"checkbox"
/>
<
g:link
action
=
"mcireditgroupoption1"
style
=
"text-decoration:none"
>
${
gvar.key
}
</
g:link
>
<
ul
>
<
g:each
in
=
"
${
gvar.value
}
"
status
=
"j"
var
=
"avar"
>
<
input
type
=
"checkbox"
/>
<
g:link
action
=
"mciragentoption3"
style
=
"text-decoration:none"
>
${
avar
}
</
g:link
>
</
g:each
>
</
ul
>
</
g:each
>
</
ul
>
</
div
>
</
td
>
Thanks for any help
Sabyasachi