DOJO Grid FIX: Showing/Hiding Grid Causes Grid Headings To Disappear

November 15, 2011 at 6:04 pm Leave a comment

DOJO has a quirky problem if you try to show/hide grids using Javascript or JQuery. This is especially trying if you have multiple grids on a page and you only want to display one at a time. If your column headers aren’t “fixed” they disappear once you hide the grid and then try to display it again.

The only way around this is to use the .resize() method on the grid reference after you try to show it again. This re-draw the grid with all the columns showing up again.

<script>

$("#showSubGridButton").click(function() {
    $("#mainGridContainer").hide();
    $("#subGridContainer").show();
    refreshGrid(subGrid);
});
$("#showMainGridButton").click(function() {
    $("#subGridContainer").hide();
    $("#MainGridContainer").show();
    refreshGrid(mainGrid);
});
function refreshGrid(gridRef) {
   gridRef.resize();
}
</script>
Advertisement

Entry filed under: Code Snippets, Development, Dojo, Fixes For Errors, for Javascript, Free Code, Freeware, Javascript, jQuery, Programming Languages, Web Design. Tags: , , , , , , , .

MySQL Workbench FIX: Cannot start SSH tunnel manager error — even when using TCP/IP connections JQuery FIX: uncaught exception: Syntax error, unrecognized expression: #

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Lost In Oblivion

November 2011
M T W T F S S
« Oct   Dec »
 123456
78910111213
14151617181920
21222324252627
282930  

Recent Posts

Feeds


Follow

Get every new post delivered to your Inbox.