简体   繁体   中英

crm 2011 hide and show subgrids on dashboard with javascript

I have two subgrids on my dashboard which are vertically aligned. I am able to hide or show either subgrid, however when I hide the top subgrid, the bottom grid does not move to the top, there is an empty space where the grid use to be. I would like to both grids appear in the same location on the page as they are shown or hidden.

I have the code below to hide/show:

setVisible('subgrid1_d', false);
setVisible('subgrid2_d', true);

function setVisible(id, show){

   if (show == true)
        $('#' + id).show();
  else
        $('#' + id).hide();
}

Any help is appreciated.

You should put your subgrids in different sections and show and hide the section where the subgrid is.

Remember that using jquery to access the form elements it is not supported, you should always use the Xrm.Page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM