how can I get the current expanded groups on client side (javascript) and how can I get(set) a collaped group to expanded it on clientside (javascript).
Check out the following code library submission which explains on how to expand/collapse all groups in groupable grid on client. This should get you started: