crm 2011 hide and show subgrids on dashboard with

2019-09-07 01:58发布

问题:

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.

回答1:

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.