How to Close a data grid

863
2
Jump to solution
12-19-2012 04:36 AM
CraigMcDade
Occasional Contributor III
Does anybody have any ideas how to create an X in the top right corner to close a dojox.grid.DataGrid? I figured it would be as easy as styling the X and creating an onclick event similar to:

<tr>                     <td align="right">                         <div class="divOk" onclick="dijit.byId('datagrid').hide();">                             X</div>                     </td>                 </tr>


but that doesn't do anything...
0 Kudos
1 Solution

Accepted Solutions
CraigMcDade
Occasional Contributor III
thanks, I wound up creating a work around for what I want by creating a new column and putting a close icon within the header. I connected it to an function so that when I click it, the grid closes and the map resizes:

function closeGrid() {   esri.hide(datagrid);   dojo.style("map", {"height": "100%"});   }


<th field="" width="2%"> <div class="GridCloseIcon" title="Close Grid" onclick="closeGrid();"></div>              </th>

View solution in original post

0 Kudos
2 Replies
RuiShen
New Contributor III
You can refer to the post below:
http://forums.arcgis.com/threads/67475-Unable-to-close-and-reopen-Floating-Panel-using-Dojox

Basically, you need to use a floating pane.
0 Kudos
CraigMcDade
Occasional Contributor III
thanks, I wound up creating a work around for what I want by creating a new column and putting a close icon within the header. I connected it to an function so that when I click it, the grid closes and the map resizes:

function closeGrid() {   esri.hide(datagrid);   dojo.style("map", {"height": "100%"});   }


<th field="" width="2%"> <div class="GridCloseIcon" title="Close Grid" onclick="closeGrid();"></div>              </th>
0 Kudos