Login Register

Grid won't re-render within contentPane

I have a single page app. A dijit.layout.borderContainer, containing dijit.layout.contentPane(s). One of the panes contains a tree, another serves as the main content. Clicking on a node of the tree loads the corresponding html file into the content pane. A few of these html pages that serve as content contain grids. Everything is done programmatically. The main page's html body is just a single empty div. The grid is created via the contentPane's onLoad function.

   mainCP = new dijit.layout.ContentPane({
      id:            'mainCP',
      region:        'center',
      href:          'content/index.html',
      style:         'padding-left: 1em;',
      refreshOnShow: true,
      preventCache:  false,
      onLoad:        mainPanelOnLoad,
      preload:       true
   }, document.createElement("div"));

mainPanelOnLoad in turn calls loadDynHdrGrid:

function loadDynHdrGrid() {
   dynHdrStore = new dojo.data.ItemFileReadStore({
      url: 'json/dynhdr2.json'
   });

   dynHdrLayout = [
      {field:'hdr', name:'Header Name', width:'100px'},
      {field:'typ', name:'Type',        width:'100px'},
      {field:'bin', name:'Binary Name', width:'100px'},
      {field:'dsu', name:'Dsu Name',    width:'auto'}
   ];

   dynHdrGrid = new dojox.grid.DataGrid({
      query:         {hdr: "*"},
      queryOptions:  {ignoreCase: true},
      clientSort:    true,
      rowSelector:   '20px',
      store:         dynHdrStore,
      structure:     dynHdrLayout
   }, 'gridNode');

   dynHdrGrid.startup();
}

The first time you view a page that contains a grid, it all works fine. However, when you navigate away from a page with a grid to any other page, then navigate back to a page with the grid that you've already rendered once, the grid will not render again. I just get an empty box.

The data are still in the browser cache, as I can dump it with firebug. Is there some grid method that I'm overlooking? I've tried setting the grid to null on page Unload. I've tried turning off caching.

Cannot navigate back to grid in the previous tab

Hi,

I have 5 tabs, each containing a grid rendered from a different jsp page. When I click on any tab for the first time, everything is fine & I get the data. The problem is when I click a tab again, I get an error. I need to refresh the tab contents each time it is selected. Am I missing out on something..?

I have a single page app too

I have a single page app too and each time a user clicks the tree I call a function that effectively re-opens the page. There, I call the grid's render method. Try this when you navigate back, if you can:

dijit.byId('myGrid').render();

Screen screwed if separate tabs clicked in quick succession

I have 5 tabs, each containing a grid rendered from a different jsp page. When I click on any tab for the first time, everything is fine & I get the data. The problem starts if I click multiple tabs in quick succession. Some of the screens just blank out / get screwed. Any solutions..?

Data gets jumbled up when the grid in the same tab is clicked.

I have 5 tabs, each containing a grid rendered from a different jsp page. When I click on any tab for the first time, everything is fine & I get the data. The problem starts if I click multiple times in quick succession on the same grid. The data gets jumbled up as the grid has a function written for onClick event . Any clues why is this happening..?